2010-01-01 25 views

回答

2

好了,你並不真正需要BorderLayout。爲了達到這種效果,您可以將分割窗格添加到一起。由於JSplitPane僅支持2個組件的拆分,因此您需要垂直2個JSplitPane,而第2個垂直JSplitPane內需要2個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);