• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding JButton to a JTree and capturing ActionEvent

 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you treating it as a Renderer or an Editor?
 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to treat it with both. But could not make it done.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic