Is there anything out there that allows you to show a small text popup window (like a tooltip) over individual words or letters in a Swing JTextArea? (Or a JTextArea alternative with similar functionality.)
What I need should behave like a tooltip, in other words only display the popup text after the mouse has hovered over the word for a second or two, and it would vanish automatically once the mouse moves away. Of course the tricky part here is that I want it at the character/word level within the text, not at the component level... any suggestions?
You can override getToolTipText(Mouse Event event)
as needed.
Addendum: JTextComponent
, the parent of JTextArea
provides location information via two methods: modelToView()
and viewToModel()
. The latter should let you translate the mouse location into a document offset.