I’m trying to create an application where there is a JSplitPane which contains the document tree on the left side and the current editor pane on the right. The editor pane has a toolbar as part of the edit pane. My problem is that when the JFrame containing the JSplitPane is resized as soon as the right component of the split pane reaches the size of the toolbar the right pane starts to ‘squish’ the left pane.
I was wondering if anyone knew of a way to keep the two components of the splitpane at the same ratio and have either the toolbar to stop displaying the items within it or have a ‘more’ button. I’ve got the tigris toolbar for the ‘more’ capability working in the frames toolbar, it just seems that it wont resize within the JScrollpane.
Thanks for the help.
if i understand correctly, you are looking to get the split pane to treat both sides with the same priority when the parent frame is getting resized. if that is the case, you may want to look at the method
JSplitPane.setResizeWeight(double).with that in mind, i would give 0.5 a try.
edit
looking at the code for the BasicSplitPaneUI, it will take the minimum size of both the left and right component into consideration when it is resizing, regardless of the the weight. the weight is still important, mind you. it is just trumped by the minimum of the components. with this in mind, try setting the minimun size on your toolbar or the scrollpane within which it is contained.