I have an application in which I have two separate dialog boxes that have multiple tabs (Panels) on them to set program options. I would like to update this UI to have a single dialog box that has a JTree on the left hand side of the dialog and have it update the Panel on the right hand side of the dialog. I am not 100% certain of how to achieve this. There are 2 issues
1) How to I update the panel corresponding to the node clicked in the JTree. I assume I need to add a listener so when a node is clicked I need to update the JPanel.
2) I assume that I do not want to create/destroy each JPanel associated with each JTree entry whenever a node is clicked. This would imply creating all JPanels when the dialog box is created. Do I create another JPanel/ScrollPane for the right hand side of the dialog box as a container and add these individual JPanels to it?
The Dialog box looks similar to
LHS RHS
JTree JPanel (changes based on JTree node selected)
The JTree looks similar to the following:
Options
Global
Connections
Storage Options
...
Session
Filters
Lists
TIA