aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes setToolTipText method 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 "setToolTipText method" Watch "setToolTipText method" New topic
Author

setToolTipText method

Samer Telawi
Greenhorn

Joined: Mar 23, 2013
Posts: 18
Dears,
currently I am working on an application in which I have small JPanels that represent some Items and I can move them by clicking on anyone of them inside another JPanel I called it sessionPanel that holds all the others, but when I add setToolTipText for the movable jpanels
I can not move them anymore
does anyone can give me a reasonable explanation
thanks
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 557
Can you post a SSCCE?


Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

the location of the tool tip is relative to the location of the panel(like dialogs). if you can, delay calling the method until it is needed(like on mouse over).
not sure if that helps any.


SCJP
Visit my download page
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2095
    
    7
When you use setToolTipText() a MouseListener is added to the component so tool tip processing can be implemented. I would guess that this mouse listener is receiving the mouse event and consuming them so they don't get passed to your mouse listener.

Try changing you code to look something like:



Swing dispatches the event in reverser order that the mouse listener is added to the component so you listener should be executed first.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setToolTipText method
 
Similar Threads
add/remove components by timer
Help needed with emoticons in a chat application
JPanel consuming Mouse Input
Movable JPanel - How?
Jpanel inside another JPanel