On my application I got the frame containing a JSplitPane. The JSplitPane is set to split horizontally. On left side there is a panel containing some components that do not matter.
On the right I got a JPanel(BoxLayout) containing subclass of JTextArea inside a JScrollPane,a JTextPane inside a JScrollPane, and a JButton.
My problem is how I get the components(mainly on the right) to resize, based on interaction
with JSplitPane. So when the JSplitPane is dragged to the left, my
JTextArea and JTextPane get wider.
I have tried different setups, also setting the preferredSize and MaximumSize but none of this seems to work. Components stay at their preferredSize. If I try to make them smaller the scrollPane works (which is fine) but when I try to get them bigger they stay at preferred size.
Most likely your problem is due to the
BoxLayoutused on your right panel. Copy-paste from the class javadoc:Use another layout which scales the inner components. For example the
CENTERarea of aBorderLayouthas such behavior.