• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automatic Tooltips popup without mousemove for Jtable

 
vince Trup
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Does anyone know of a way to generate a html type popup without mouse usage?
The message just needs to appear for 5 seconds when the JTable is first displayed at a hardcoded Point object pixel location.

I already have header tooltips added as such-
String [] myToolTipsText =
{
"<html>XXX.<br>XXX</br></html>",
"<html>XXX.<br>XXX</br></html>",
"<html><br>YYY</br><br>ZZZ</br></html>", };

Thanks for any help out there.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if this is pure java, there is Robot.mouseMove(..) which will put the cursor
where you want it, and display a tooltip (if set).

[edit] - typo
[ March 02, 2008: Message edited by: Michael Dunn ]
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a custom JWindow for this. Override the setVisible() method to start a timer that disposes the JWindow:

You add one single JLabel to the window's content pane which shows the tooltip. You could add a mouse listener to the label to close the window when someone clicks on the label.

If you want this popup to block all input to the rest of the program, use a JDialog instead and call setUndecorated(true) on it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic