请在链接中查看我的图片,然后阅读下面的内容以获取有关我的问题的更多详细信息。

想象一下,这是一个用 JSplitPane 一分为二的基本框架,默认情况下,当您调整框架大小时,灰色部分会发生变化它的大小,但我希望白色部分能够根据框架大小的调整而调整大小。
任何朝着正确方向的帮助将不胜感激,因为我现在正在开发一个项目,并且我正在尝试各种奇怪的东西,为我在新的一年中最大的项目做好准备。 :)
问候
塞隆
Please see my image below at the link and then read below it for more details on my problem.

Imagine that is a Basic frame splited into two with a JSplitPane, by default when you resize your frame the gray part changes it's size, but I would like the white part to resize accordingly to the frame resizing.
Any help into the right direction would be appreciated as I am working on a project now and I am trying out all kind of weird stuff to be prepared for my biggest project set in the new year. :)
Regards
Theron
发布评论
评论(1)
您需要使用
setResizeWeight
来让左右在 JFrame 调整大小时占用额外的空间或减小大小,示例代码如下:Java Doc for setResizeWeight。
希望这有帮助。
You need to use
setResizeWeight
to get the left and right take the extra space or reduce in size on JFrame resize, sample code below:Java Doc for setResizeWeight.
Hope this helps.