Need to have a button for every node in the JTree. Please help... Urgent!

Hi,I need a tree whose editor is a JButton. I was able to render the tree with a JButton. But, the editor is not working. I mean the button is only shown but, unable to click it. Please help me.Thanks in advance,Rajesh
[246 byte] By [Rajesh.Debnatha] at [2007-11-27 4:24:57]
# 1
Seems nobody wants to help me :(
Rajesh.Debnatha at 2007-7-12 9:32:58 > top of Java-index,Desktop,Core GUI APIs...
# 2
Somebody please help me. If more information is required I can give.Thnx
Rajesh.Debnatha at 2007-7-12 9:32:58 > top of Java-index,Desktop,Core GUI APIs...
# 3

It's a bit complicated. The default cell renderer doesn't actually put the tree nodes on your screen, it just paints the looks of them. That is, you see them on screen, but they are just painted, all mouse clicks etc. are sent directly to the JTree.

In order to have a button in a tree node, and have that button respond to clicks, I believe you'd have to put the button in a TreeCellEditor. This means users will have to triple click the node to get the Editor in the renderer's place (db click only expands/implodes nodes).

I have sucessfully used http://propertytree.dev.java.net/ to customize the behaviour of tree nodes, but I never have put a button in there... Have a look, you'll see what methods you need to overwrite.

rebola at 2007-7-12 9:32:58 > top of Java-index,Desktop,Core GUI APIs...