*
The moose likes Swing / AWT / SWT and the fly likes Adding JButton to a JTree and capturing ActionEvent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Adding JButton to a JTree and capturing ActionEvent" Watch "Adding JButton to a JTree and capturing ActionEvent" New topic
Author

Adding JButton to a JTree and capturing ActionEvent

buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136

I am adding a JButton to the JTree. The moment I add JTree doesnt treat it as Button rather it treats as a node and all my listeners on JButton go in air. So, how can I trigger ActionEvent from JTree node?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Are you treating it as a Renderer or an Editor?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136

I tried to treat it with both. But could not make it done.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
so how many threads are you going to create on the same subject?

http://www.coderanch.com/t/490561/Swing-AWT-SWT-JFace/java/add-JLabel-any-leaf-JTree

your last subject title suggests JLabel, but evolves into JButton et al.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding JButton to a JTree and capturing ActionEvent