Get your CodeRanch badge!*
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 Java 8 in Action this week in the Java 8 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
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: 19557
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Automatic Tooltips popup without mousemove for Jtable
 
Similar Threads
Urgent: JTable Header position
JTable
How to set next line in ToolTip
MultiLine Headers with Icons for a JTable
Displaying a carriage return in a jTable row.