[jsword-devel] Hebrew/Greek defs as tooltips

Tonny Kohar tonny.kohar at gmail.com
Mon Jan 11 22:34:47 MST 2010


Hi,

On Mon, Jan 11, 2010 at 8:45 PM, Yingjie Lan <lanyjie at yahoo.com> wrote:
>
> Wow, this is cool. Do you need to subclass JToolTip to achieve that?

no I didn't subclass JToolTip.
I just create a panel with scrollbar (JScrollPane) and the JEditorPane
(with html renderer enabled). Then embed that panel into
javax.swing.Popup
eg:
popup = PopupFactory.getSharedInstance().getPopup(owner,
myTooltipPanel, prefPoint.x, prefPoint.y);
popup.show();

I choose to use jpanel because it allow much more customability rather
than subclass JToolTip. With JPanel you can even put button, toolbar,
etc if you need it.

Cheers
Tonny Kohar
--
Alkitab Bible Study
http://www.kiyut.com/products/alkitab/index.html



More information about the jsword-devel mailing list