import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class InternalFrameSample extends JPanel implements ActionListener{

  static JDesktopPane desktop;
  JButton b1, b2, b3;
  public InternalFrameSample() {
	super();	

	desktop = new JDesktopPane();

	JToolBar toolbar = new JToolBar();
	b1 = new JButton ("Scroll Sample");
	b2 = new JButton ("Split Sample");
	b3 = new JButton ("Tree Sample");

        toolbar.add(b1);  b1.addActionListener(this);
        toolbar.add(b2);  b2.addActionListener(this);
        toolbar.add(b3);  b3.addActionListener(this);

        //Add the desktop pane to this panel.
	add(desktop);
	createInternalFrame();
   }

   public void actionPerformed (ActionEvent e) {
	JInternalFrame frame;
	if (e.getSource() == b1) {
        }
   }

   public static void createInternalFrame() {
           JInternalFrame fr = new JInternalFrame("Scroll", true, true, true, true);
           fr.setContentPane(new ScrollSample());
           fr.setSize(100,100);
           fr.setLocation(100,100);
           desktop.add(fr);
           try {
            fr.setSelected(true);
           } catch (java.beans.PropertyVetoException e2) {}
	   System.out.println("Created a Frame");
   }

	   
   public static void main (String args[]) {
	InternalFrameSample app = new InternalFrameSample();
	JFrame frame = new JFrame ("My Application");
	desktop = new JDesktopPane();
	frame.setSize(400,400);
	frame.setContentPane(desktop);
	frame.pack();
	frame.show();
   }
}


         
