/**
 * FrameViewer, from slides. We experimented with close behavior.
 * 
 * Lect 24, Apr 4 2006
 * 
 */

import javax.swing.JFrame;

public class FrameViewer
{
  public static void main(String[] args)
  {
    JFrame myframe = new JFrame();  // make a new JFrame object
    
    //final int F_WIDTH = 300;        // 300 pixels wide
    final int F_WIDTH = 900;        // Experiment: make window wider
    final int F_HEIGHT = 400;       // 400 pixels high
    
    myframe.setSize(F_WIDTH, F_HEIGHT);
    myframe.setTitle("My Frame");   // this is optional
    //myframe.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    // Experiment: make the close button do nothing. We also found that the
    // default is HIDE_ON_CLOSE, which might seem like exit since window
    // vanishes, but when we look carefully we see that the program is still
    // running.
     myframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
    RectangleComponent component = new RectangleComponent();
    myframe.add(component);
    
    myframe.setVisible(true);
  }
}


