File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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

Automatic Tooltips popup without mousemove for Jtable

vince Trup

Joined: Mar 02, 2008
Posts: 2

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><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

Joined: Oct 27, 2005
Posts: 20183

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.

How To Ask Questions How To Answer Questions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Automatic Tooltips popup without mousemove for Jtable
It's not a secret anymore!