  // Swing JSplitPane Example - Derek Molloy

  import javax.swing.*;
  import java.awt.*; 

  public class JSplitPaneExample extends JFrame
  {	
	
	public JSplitPaneExample()
	{
		super("JSplitPane Example");

		JScrollPane pane2 = new JScrollPane(new JTextArea("A test text area",20,20)
			, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
			  JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

		JScrollPane pane1 = new JScrollPane(new JLabel(new ImageIcon("test.jpg"))
			, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
			  JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                           pane1, pane2);
		splitPane.setOneTouchExpandable(true);
		splitPane.setDividerLocation(400);

		
		this.getContentPane().add("Center", splitPane);

		this.setSize(600,400);	// set the size 
		this.show();	// display the frame
	}
	
	
	public static void main(String[] args)
	{
		new JSplitPaneExample();
	}
  }

