當(dāng)使用JSplitpane分隔面板時(shí)
可以通過 splitPaneMain.setOneTouchExpandable(true);
設(shè)置 oneTouchExpandable 屬性的值,要使 JSplitPane 在分隔條上提供一個(gè) UI 小部件來快速展開/折疊分隔條
但是如果要初始化時(shí)默認(rèn)就折疊一邊的話 網(wǎng)上搜索添加下面幾句就可以了,但是驗(yàn)證了下只有在一邊沒加控件時(shí)才行
// Hide left or top
splitPaneMain.getLeftComponent().setMinimumSize(new Dimension());
splitPaneMain.setDividerLocation(0.0d);
// Hide right or bottom
splitPaneMain.getRightComponent().setMinimumSize(new Dimension());
splitPaneMain.setDividerLocation(1.0d);