  // Swing JTabbed Pane Example - Derek Molloy

  import javax.swing.*;
  import java.awt.*; 

  public class JTabbedPaneExample extends JFrame
  {	
	
	public JTabbedPaneExample()
	{
		super("JTabbed Pane Example");

		JPanel panel1 = new JPanel();	
		panel1.add(new JScrollPane(new JTextArea("A test text area",20,20)
			, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
			  JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));

		JPanel panel2 = new JPanel();
		panel2.add(new JLabel("Test Label"));
		panel2.add(new JButton("Test Button"));	

		ImageIcon theIcon = new ImageIcon("next.gif");

		JTabbedPane tabbedPane = new JTabbedPane();
		tabbedPane.addTab("Tab One", theIcon, panel1, "This is The First Tab");
		tabbedPane.addTab("Tab Two", theIcon, panel2, "This is The Second Tab");

		this.getContentPane().add("Center", tabbedPane);

		this.pack();	// set the size automatically
		this.show();	// display the frame
	}
	
	
	public static void main(String[] args)
	{
		new JTabbedPaneExample();
	}
  }

