I have a wizard with several screens where the user must fill in their data for further processing. On the second screen, I have a radio group with three radio buttons that allow me to add additional elements. To continue, the user must select one of them. When the user selects the third button, one selection JTreefilled with data is turned on , and the user must select an option from it. Then the user must click “Next” to go to the next screen. The option he selected is saved as TreePath. So far so good.
My problem is as follows. If the user wants to return from the next screen to the screen with JTree, I want to provide it with an JTreeextension to the selected option and highlight the option. However, all I'm trying to make up for it (any combination of expandPath, scrollPathToVisible, addSelectionPath, makeVisible) always provide me with a rolled wood. I am trying to expand both leaves and nodes. My code is as follows:
rbProcessJTree.setSelected(isProcessJTree());
if (null != getSelectedTablePath()){
trTables.addSelectionPath(getSelectedTablePath());
trTables.expandPath(getSelectedTablePath());
trTables.scrollPathToVisible(getSelectedTablePath());
}
When called setSelected(), the state change listener is called, which allows JTree. The model is loaded during form initialization.
, , . , , , , . , .
, JTree ?