JSplitPane: setOrientation(JSplitPane.HORIZONTAL_SPLIT)
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
public class MainClass {
public static void main(String args[]) {
JFrame frame = new JFrame("JSplitPane Sample");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JSplitPane splitPane = new JSplitPane();
splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
frame.add(splitPane, BorderLayout.CENTER);
frame.setSize(300, 200);
frame.setVisible(true);
}
}
Related examples in the same category