The split pane supports a one-touch-expandable capability that allows the user to conveniently move the divider to either end with a single click
import javax.swing.JButton;
import javax.swing.JSplitPane;
public class Main {
public static void main(String[] argv) throws Exception {
JButton topComponent = new JButton("top");
JButton bottomComponent = new JButton("bottom");
JSplitPane vpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topComponent, bottomComponent);
boolean b = vpane.isOneTouchExpandable(); // false by default
vpane.setOneTouchExpandable(true);
}
}
Related examples in the same category