Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #37373

Re: how to convert html?

Newsgroups comp.lang.java.programmer
Date 2017-08-31 13:37 -0700
References (6 earlier) <804837be-8404-48df-8f3c-b6a1672e3a3a@googlegroups.com> <8a035a47-e940-4153-b595-c3a65da887ec@googlegroups.com> <oo9job$hnv$1@dont-email.me> <c20a9a60-2ac5-4332-bd53-d578957d7d00@googlegroups.com> <oo9p5k$4c5$1@dont-email.me>
Message-ID <b85fd7a1-9f9d-4c01-8dae-15a1dbe35ebe@googlegroups.com> (permalink)
Subject Re: how to convert html?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Thursday, August 31, 2017 at 3:52:48 PM UTC-4, Knute Johnson wrote:
> In that case I think I would be tempted to only use HTML in the 
> JToolTips and then they will all render the same.  You can put the CSS 
> styles in the HTML if you want and skip all the HTMLEditorKit and 
> StyleSheet stuff.
> 
> The CSS version is quite old and limited in Swing and I don't know that 
> it will ever be updated.  I love Swing but it is showing its age.
> 
> I'm curious though have you figured out a way to get at the actual 
> JToolTip from a JComponent?
> 
> -- 
> 
> Knute Johnson

If you set the matching properties as I mentioned, if they're not rendering exactly the same I think they're close enough.  I didn't look at the flag they're using to determine if the text is html but it seems ugly to force html tips where they're not needed.

The stylesheet stuff sounds cleaner than intercepting every setToolTipText to force it into html code.  This css sets a default font and a default background each tooltip may override if they need something special.

I've heard people say before that Swing is old as if it's outdated but I haven't found anything I really can't do with it.  Of course it is extremely modern compared to what we started with 17 years ago.  I've been working on an API for about 10 years.  I'd love to show you what it can do.  I've extended every Swing class I could find a use for and made them do so much more.  I have quite a long list now of what I can do with a JTable.  One thing Swing hasn't been good at is rendering a full scale web site, but it does have a way to integrate a Java FX component for that, and I haven't had much use for that.  The limited html/css functionality in the tool tips and other components, as you say the JLabel and of course the JTextPane, seems sufficient for a business application.

Other than instantiating a JToolTip for rendering the tool tip text on a report I'm not sure what you'd need to access the actual JToolTip from a JComponent for.  I'm sure that functionality is there if you dig enough but why.  I did customize JPopupMenu, made the regular list menu scrollable with an adjustable max visible items, and made one display a calendar for a date input inquiry...

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


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