how can you programmatically set the JSplitPane to hide the right/bottom component when OneTouchExpandable is set to true?

前端 未结 5 1084
遥遥无期
遥遥无期 2021-01-06 06:30

In a JSplitPane, you have the setOneTouchExpandable method which provides you with 2 buttons to quickly fully hide or full show the JSplitPan

5条回答
  •  無奈伤痛
    2021-01-06 06:50

    You can simply use this:

    public void setDividerLocation(double proportionalLocation)
    
    splitPane.setDividerLocation(0.0d);
    

    or.

    splitPane.setDividerLocation(1.0d);
    

    depending on wheter yourwant to hide the left component first or the right component.

提交回复
热议问题