I’m trying to use setDividerLocation on JSplitPane to size the two panels in a “best size” fashion so that the vertical scroll bar doesn’t appear in the top panel. The split location should be just after the last of the data in the top panel.
Using jSplitPane1.setResizeWeight(1D) reserves too much space for the top component, resulting in empty space beneath the data.
I’m trying to get it just right!

I assume you have a
JTableas main component in upper side of the splitpane? If so you could do like this: