I'm trying out the JSplitPane with a couple of scrollable side-by-side JTables.
However I'm experiment a behavior where the JScrollPane gets shrinked too much, as per gif.
Notice the left component, that besides having a minimum width of 250px, continues shrinking.
The relevant code is
final var objetsTable = new JTable();
final var objectsScrollPane = new JScrollPane(objetsTable);
objectsScrollPane.setMinimumSize(new Dimension(250, 0));
objectsScrollPane.setPreferredSize(new Dimension(400, 300));
final var stepsTable = new JTable();
final var stepsScrollPane = new JScrollPane(stepsTable);
stepsScrollPane.setMinimumSize(new Dimension(150, 0));
stepsScrollPane.setPreferredSize(new Dimension(200, 300));
final var splitPane = new JSplitPane();
splitPane.setLeftComponent(objectsScrollPane);
splitPane.setRightComponent(stepsScrollPane);
splitPane.setResizeWeight(1.0);
How can I avoid the JScrollPanes getting shrinked too much in this case?

The
getMinimumSizecalled on aJSplitPanereturns a size which is actually taking into account the minimum size of its left and rightComponents, plus the divider size. So one way to maybe solve your problem would be to make yourJSplitPaneimplementScrollable(in order to make it respect the minimum size of itself) and add it to aJScrollPane. This way you can ensure that the minimum size is respected and when the user continues shrinking theScrollableJSplitPanepast its minimum size, then the scroll bars will show up.Here is some working code: