Skip to content
Advertisement

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

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

My question is how can you programmatically “click” the hide button on the JSplitPane?

I may have wrongly explained myself. I want the splitpane to show only one of the 2 components at start (this is what i mean by clicking).

This works:

JavaScript

but replacing 0.0 with 1.0 doesn’t hide the right component. This is my problem!

Advertisement

Answer

JavaScript

replace 0.0 with 1.0 and you get my problem

Read the fine manual and solve the problem.

This method immediately changes the size of the split pane based on its current size. If the split pane is not correctly realized and on screen, this method will have no effect

SplitPaneDefault

JavaScript
Advertisement