Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #37368
| X-Received | by 10.176.85.193 with SMTP id w1mr3066816uaa.49.1504188737135; Thu, 31 Aug 2017 07:12:17 -0700 (PDT) |
|---|---|
| X-Received | by 10.31.162.84 with SMTP id l81mr46495vke.15.1504188737087; Thu, 31 Aug 2017 07:12:17 -0700 (PDT) |
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u11no2529581qtu.1!news-out.google.com!j49ni1027qtc.1!nntp.google.com!u11no2529575qtu.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.programmer |
| Date | Thu, 31 Aug 2017 07:12:16 -0700 (PDT) |
| In-Reply-To | <804837be-8404-48df-8f3c-b6a1672e3a3a@googlegroups.com> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=50.78.95.177; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H |
| NNTP-Posting-Host | 50.78.95.177 |
| References | <1d4eecd0-a437-4541-841a-4cba7fef7380@googlegroups.com> <oo6n5i$i41$1@dont-email.me> <a53e0873-5233-4509-8099-b7c57b7c974e@googlegroups.com> <oo74pl$3q4$1@dont-email.me> <8e62a8c5-8a8c-4f32-96a2-adbd437a9726@googlegroups.com> <0df9b410-65f7-4064-8748-f35691ef7355@googlegroups.com> <804837be-8404-48df-8f3c-b6a1672e3a3a@googlegroups.com> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <8a035a47-e940-4153-b595-c3a65da887ec@googlegroups.com> (permalink) |
| Subject | Re: how to convert html? |
| From | Eric Douglas <e.d.programmer@gmail.com> |
| Injection-Date | Thu, 31 Aug 2017 14:12:17 +0000 |
| Content-Type | text/plain; charset="UTF-8" |
| Lines | 23 |
| Xref | csiph.com comp.lang.java.programmer:37368 |
Show key headers only | View raw
On Thursday, August 31, 2017 at 8:56:45 AM UTC-4, Eric Douglas wrote:
>
> Actually, I forgot, I am still creating the style sheet somewhere. It doesn't look right if you don't do this, no idea why.
I'm getting there...
javax.swing.plaf.basic.BasicToolTipUI.paint
...
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, paintTextR);
} else {
g.setFont(font);
SwingUtilities2.drawString(c, g, tipText, paintTextR.x,
paintTextR.y + metrics.getAscent());
}
So if I call setText on my JToolTip with a plain string then call this getClientProperty it returns null. If I call setText, string starting with <html> then call this getClientProperty, it returns a javax.swing.plaf.basic.BasicHTML$Renderer.
So I trace that to the source
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/javax/swing/plaf/basic/BasicHTML.java?av=f
and find that I can just call setFont() on my JToolTip, then for html font I call BasicHTML.updateRenderer(myToolTip,myToolTip.getTipText()). That uses that style sheet logic and updates it from the JToolTip's font, except it doesn't do underlines..
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/swing/SwingUtilities2.java#SwingUtilities2.displayPropertiesToCSS%28java.awt.Font%2Cjava.awt.Color%29
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-30 07:03 -0700
Re: how to convert html? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-08-30 10:59 -0500
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-30 11:41 -0700
Re: how to convert html? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-08-30 14:52 -0500
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-30 14:00 -0700
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-31 05:47 -0700
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-31 05:56 -0700
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-31 07:12 -0700
Re: how to convert html? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-08-31 13:20 -0500
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-31 11:49 -0700
Re: how to convert html? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-08-31 14:52 -0500
Re: how to convert html? Eric Douglas <e.d.programmer@gmail.com> - 2017-08-31 13:37 -0700
csiph-web