Link to home
Start Free TrialLog in
Avatar of nesnemis
nesnemis

asked on

How to use double-click to make JTree nodes editable

I'm having some difficulties making my JTree component work as I prefer. I have created a JTree with nodes consisting of four Jlabel components. When the user double-clicks on a node, I want it to become editable. My problem is that by default a node in a JTree is editable when a user clicks the node just once. This makes it imipossible to select a node without making it editable. Does anyone know any good way to handle this, so the nodes in the tree only is editable when the user double-clicks it. I am looking for something similar like the method SetToggleClickCount(), but havent found anything that works the way I prefer so far.

Please help me, I have spent way too much time trying to solve this!!

Thanks in advance,

BOB
ASKER CERTIFIED SOLUTION
Avatar of Giant2
Giant2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of hoomanv
hoomanv
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Giant2
Giant2

isaihat,
link allready posted (sun book)
;-)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry Giant2
i opened and i copy it by mistake