The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing  [141 examples] > JSplitPane  [5 examples]

e827. Setting the Size of the Divider in a JSplitPane Container

A divider can be no less than one pixel in size.
    // Create a left-right split pane
    JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent);
    
    // Get current size; it is look and feel dependent
    int size = pane.getDividerSize();
    
    // Set a new size
    size = 1;
    pane.setDividerSize(size);

 Related Examples
e823. Creating a JSplitPane Container
e824. Getting the Setting the Children in a JSplitPane Container
e825. Distributing Space When a JSplitPane Container Is Resized
e826. Getting and Setting the Divider Location in a JSplitPane Container

See also: Actions    JButton    JCheckBox    JComboBox    JDesktop and JInternalFrame    JFrame, JWindow, JDialog    JLabel    JList    JProgressBar    JRadioButton    JScrollPane    JSlider    JSpinner    JTabbedPane    JToolBar    Keystrokes and Input Maps    Layout    Look and Feel    Menus    Progress Monitor    The Screen    Tool Tips    UI Default Values   


© 2002 Addison-Wesley.