aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Automatic Tooltips popup without mousemove for Jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Automatic Tooltips popup without mousemove for Jtable" Watch "Automatic Tooltips popup without mousemove for Jtable" New topic
Author

Automatic Tooltips popup without mousemove for Jtable

vince Trup
Greenhorn

Joined: Mar 02, 2008
Posts: 2
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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Oct 27, 2005
Posts: 19723
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: Automatic Tooltips popup without mousemove for Jtable