你好,
我如何使用 JSplitPane 以便它们显示在 BorderLayout 的边框中???
这样我就可以调整每个尺寸(NORTH,EAST,WEST,SOUTH,CENTER)。
谢谢
你好,
我如何使用 JSplitPane 以便它们显示在 BorderLayout 的边框中???
这样我就可以调整每个尺寸(NORTH,EAST,WEST,SOUTH,CENTER)。
谢谢
好吧,你真的不需要BorderLayout
。您可以将拆分窗格添加在一起以获得该效果。因为JSplitPane
仅支持拆分 2 个组件,所以您需要 2 个JSplitPane
垂直,而 2JSplitPane
在第二个垂直内JSplitPane
。
JSplitPane horizontal1 = new JSplitPane(
JSplitPane.HORIZONTAL_SPLIT, yourCenterPanel, yourEastPanel);
JSplitPane horizontal2 = new JSplitPane(
JSplitPane.HORIZONTAL_SPLIT, yourWestPanel, horizontal1);
JSplitPane vertical1 = new JSplitPane(
JSplitPane.VERTICAL_SPLIT, horizontal2, yourSouthPanel);
JSplitPane vertical2 = new JSplitPane(
JSplitPane.VERTICAL_SPLIT, yourNorthPanel, vertical1);
whateverPlaceYouWant.add(vertical2);