How do I make this FlowLayout wrap within its JSplitPane?

℡╲_俬逩灬. 提交于 2019-12-01 11:59:17

Is there another layout manager besides FlowLayout that will do what I'm looking for?

Wrap Layout should work.

If you add this

bottomleft.setMinimumSize(new Dimension(0, 0));

before the pack() then it'll reflow. BUT, it won't re-pack the border layout, so instead of two lines you'll get one with the rest cut off. So after a resize you'll have to repack the border layout. If you omit the border layout then it'll reflow like you want.

That said, you should avoid FlowLayout like the plague. Most of the layouts that come with Swing are poor, but FlowLayout is one of the worst offenders.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!