problems with JSplitPane
Hi friends,
I've got problems with a JSplitPane I'm using in my application. The left component has a JTree that is used as a menu, each time a node is selected, the right component of the splitpane must change.
Here's how I handle tree selections:
publicvoid valueChanged(TreeSelectionEvent e){
// check params
if( e ==null )return;
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) this.menuTree.getLastSelectedPathComponent();
Object userObject = selectedNode.getUserObject();
if( userObjectinstanceof String ){
String command = (String) userObject;
if( command.equals(LEVEL2AA_STRING) ){
// display the skill panel.
this.rightPanel =new SkillPanel();
}
else
if( command.equals(LEVEL2BB_STRING) ){
// panel for editing cities
this.rightPanel =new ProvincePanel();
}
// display the panel
this.splitter.setRightComponent(new JScrollPane(this.rightPanel) );
It works, but I've got annoying problem of refreshing. In particular, whena voice is selected, I have to change size to the frame that contains the splitpane to see the right part of the panel. It seems as the right part of the window is not shown (i debugged the application and the right component is correctly created and placed).
How can I solve this problem?
Thanks,
Luca

