Hello, I've got a problem. In fact, i have a JFrame with on the left a JTree and on the right some JEditorPane and 3 JButton (New, Save, Cancel). When I clic on a JTree's Node, my JEditorPane are updated with desirated info.
I would like when i clic on JButton New, it is impossible to click on another Node in the Jtree: to block the Jtree or block event on Jtree. I've tried but my CellRenderer applied to the JTree disappears ... I've also tried but it doesn't work. If someone have a idea ThanX !
Hmmm... it sounds like you want to do the following...
The user clicks nodes of the tree, data represented by the node appears in the panel to the right. If the user clicks "New" they are adding new data to the tree, but it doesn't create a node in the tree until the user hits "Save". If the user hits "Cancel" during this process the data is not saved and a corresponding node does not appear in the tree. The user should not click on a node and have data appear during the editing process because there is no way to get back to the new data they were editing.
My suggestion would be have the "New" button set some boolean (I'm calling it "editing") to true. Have either the listener of the nodes or the method that updates your fields make sure that editing==false before it sets the data in your fields. Have "Save" and "Cancel" Buttons reset editing to false.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.