JSplitPane: getLeftComponent() : JSplitPane « javax.swing « Java by API






JSplitPane: getLeftComponent()

  
import javax.swing.JButton;
import javax.swing.JSplitPane;

public class Main {
  public static void main(String[] argv) throws Exception {
    JButton leftComponent = new JButton("left");
    JButton rightComponent = new JButton("right");

    JButton topComponent = new JButton("top");
    JButton bottomComponent = new JButton("bottom");

    JSplitPane hpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent);

    JSplitPane vpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topComponent, bottomComponent);

    leftComponent = (JButton) hpane.getLeftComponent();
    rightComponent = (JButton) hpane.getRightComponent();

    topComponent = (JButton) vpane.getTopComponent();
    bottomComponent = (JButton) vpane.getBottomComponent();

    hpane.setLeftComponent(topComponent);
    hpane.setRightComponent(bottomComponent);

    vpane.setTopComponent(leftComponent);
    vpane.setBottomComponent(rightComponent);
  }
}

   
    
  








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: getRightComponent()
8.JSplitPane: getTopComponent()
9.JSplitPane: resetToPreferredSizes()
10.JSplitPane: setContinuousLayout(boolean newContinuousLayout)
11.JSplitPane: setDividerLocation(double proportionalLocation)
12.JSplitPane: setDividerSize(int newSize)
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)