new JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent) : JSplitPane « javax.swing « Java by API






new JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)

  
import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;

public class MainClass extends JFrame {

  static String sometext = "Text Text Text Text Text Text Text Text Text Text Text Text ";

  public MainClass() {
    super("Simple SplitPane Frame");
    setSize(450, 200);
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    JTextArea jt1 = new JTextArea(sometext);
    JTextArea jt2 = new JTextArea(sometext);

    jt1.setLineWrap(true);
    jt2.setLineWrap(true);
    jt1.setMinimumSize(new Dimension(150, 150));
    jt2.setMinimumSize(new Dimension(150, 150));
    jt1.setPreferredSize(new Dimension(250, 200));
    JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jt1, jt2);
    getContentPane().add(sp, BorderLayout.CENTER);
  }

  public static void main(String args[]) {
    MainClass ssb = new MainClass();
    ssb.setVisible(true);
  }
}

           
         
    
  








Related examples in the same category

1.JSplitPane.LAST_DIVIDER_LOCATION_PROPERTY
2.JSplitPane.VERTICAL_SPLIT
3.JSplitPane: addHierarchyListener(HierarchyListener l)
4.JSplitPane: getBottomComponent()
5.JSplitPane: getDividerLocation()
6.JSplitPane: getLeftComponent()
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)