Hi all,
in my window I've got a JSplitPane with the left component that is a JScrollPane with a Jtree (used as a menu), while in the right side a customized JPanel that changes depending on the selection in the tree on the left.
My panels are initially created as follows:
this.splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
this.splitter.setOneTouchExpandable(true);
JScrollPane leftPanel = new JScrollPane( this.menuTree );
leftPanel.setMinimumSize( new Dimension(300,300) );
leftPanel.setMaximumSize(leftPanel.getMinimumSize());
// add the leftt and right panels
this.splitter.setLeftComponent( leftPanel );
this.imagePanel = new ImagePanel(ComponentBuilder.getLogoPath());
this.rightPanel = this.imagePanel;
this.splitter.setRightComponent(this.rightPanel);
// add the splitter to myself
this.add(new JScrollPane(this.splitter));
where the imagepanel is a working panel that shows the project logo. Now what happens is that:
1) the logo is cutted to a size I don't know how is calculated, since the image panel is working fine (if I place on a separate window I can see the image right)
2) most important when a user selects something in the tree on the left panel, so the right panel changes, the left panel is moved around the window depending on the size of the right panel.
Is it possible to fix the left panel not only as size, but also in the position of the window, thus the remaining part of the window will be occupied by the right panel without moving the left one? In my frame I'm using a BorderLayout, and the panel containing the splitpane is set at the center (no components on the right and on the left).
Thanks,
Luca