I've got a project in Java where I have a frame which is divided in 2 panels. The left panel consists of a JTabbedPane
and the right panel of a JTree
. These are 2 different classes. Now if I doubleclick on a item in the Jtree
, I want the tabbed pane to switch to the tab about the node I pressed on and fill in the data.
For example when I press on a student, I want to jump to the student tab and fill in the details I can get out of the tree, name etc.
I know you can use a selection listener with the tree and use the setindexat for the tabs, but my biggest problem is I don't know how the classes can communicate with eachother. Does anybody have a idea?