This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all. I have expanded on Sun's tree example. I added another JTree into another JPanel and added both Panels to one larger panel. I'm trying to add nodes to either one. To do this, I would like the user to select a node with the mouse and then click the add button. This will add a new node. The problem is I am having trouble distinguisihing between the two JTrees. Both trees are of class DynamicTree. (treePanel, treePanel2) You will find XXXXXX in my code. If I replace the XXXX with treePanel it works for the tree on left. If I use treePanel2, it works for the one on the right. That I have no problem with. How could I maybe use the MouseListener inerface or someother listener to get it to work??? I've enclosed both classes (DynamicTree and DynamicTreeDemo) for your enjoyment. I hope your enjoyment will ease my frustration. Thanks in advance.