This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes no mouseClicked when TransferHandler set for JLabel? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "no mouseClicked when TransferHandler set for JLabel?" Watch "no mouseClicked when TransferHandler set for JLabel?" New topic
Author

no mouseClicked when TransferHandler set for JLabel?

Mike Mayer
Greenhorn

Joined: Jul 03, 2003
Posts: 1
I extended a JLabel to make it draggable by adding a TransferHandler. The only method in the mouse listener that gets called is mousePressed. I would still like to detect a mouse click on the label. Is there a way to do this? It appears that setting the transfer handler on the component makes it treat any mouse activity as a possible drag.
daniel xiao
Greenhorn

Joined: Jul 04, 2003
Posts: 12
You can Implements MouseListener,
addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) { }
public void mouseExited(MouseEvent e){ }
});
daniel xiao
Greenhorn

Joined: Jul 04, 2003
Posts: 12
How to make JLabel text display many rows
Exclusion of this method:
JLabel.setText("<html>hhhhh<br>jjjjjj</html>")
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no mouseClicked when TransferHandler set for JLabel?
 
jQuery in Action, 3rd edition