JSplitPane: setDividerSize(int newSize) : JSplitPane « javax.swing « Java by API






JSplitPane: setDividerSize(int newSize)

  
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JSplitPane;

public class Main{
  
  public static void main(String[] a) {
    int HORIZSPLIT = JSplitPane.HORIZONTAL_SPLIT;
    int VERTSPLIT = JSplitPane.VERTICAL_SPLIT;
    boolean continuousLayout = true;
    JLabel label1 = new JLabel("a");
    JLabel label2 = new JLabel("b");
    JLabel label3 = new JLabel("c");
    JSplitPane splitPane1 = new JSplitPane(VERTSPLIT, continuousLayout, label1, label2);
    splitPane1.setOneTouchExpandable(true);
    splitPane1.setDividerSize(2);
    splitPane1.setDividerLocation(0.5);

    JSplitPane splitPane2 = new JSplitPane(HORIZSPLIT, splitPane1, label3);
    splitPane2.setOneTouchExpandable(true);
    splitPane2.setDividerLocation(0.4);
    splitPane2.setDividerSize(2);

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(splitPane2);
    frame.pack();
    frame.setVisible(true);
  }
}

   
    
  








Related examples in the same category

1.JSplitPane.LAST_DIVIDER_LOCATION_PROPERTY
2.JSplitPane.VERTICAL_SPLIT
3.new JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
4.JSplitPane: addHierarchyListener(HierarchyListener l)
5.JSplitPane: getBottomComponent()
6.JSplitPane: getDividerLocation()
7.JSplitPane: getLeftComponent()
8.JSplitPane: getRightComponent()
9.JSplitPane: getTopComponent()
10.JSplitPane: resetToPreferredSizes()
11.JSplitPane: setContinuousLayout(boolean newContinuousLayout)
12.JSplitPane: setDividerLocation(double proportionalLocation)
13.JSplitPane: setLeftComponent(Component comp)
14.JSplitPane: setOneTouchExpandable(boolean newValue)
15.JSplitPane: setOrientation(JSplitPane.HORIZONTAL_SPLIT)
16.JSplitPane: setResizeWeight(double value)
17.JSplitPane: setRightComponent(Component comp)