我有一个JScrollPane里面有一个JList;
instructionsScrollPane = new JScrollPane(instructionList);
JScrollPaneis 本身在usingJPanel中BorderLayout;
panel.add(instructionsScrollPane, BorderLayout.WEST);
现在,我试图在调整窗口大小时阻止列表/滚动窗格低于某个最小大小,除非JScrollPane不能设置最小大小,并且列表在JScrollPane其中不能有layoutManager. 所以我无法设置JList没有layoutManager...的最小尺寸
现在,我想我可以让 JScrollPane/JList在当前BorderLayout内部使用另一个JPanel(然后我会设置一个最小大小)居中panel......但这看起来很混乱。有谁知道调整 ScrollPanes 大小的更好方法?
我知道可能有一个使用不同的解决方案layoutManager,但我已经承诺BorderLayout在这一点上使用。