File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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?
 
Similar Threads
generic inheritance
looking for help on Swing DND (unsupported JComponents)
how can I change this tree with different Icons for Different nodes at Run Time
Need help exporting to clipboard
Drag and Drop between 2 JLists - ReportingListTransferHandler