Source of TryWindow1.java


  1: //TryWindow1.java
  2: //Opens a window of a certain size at a certain position.

  4: import javax.swing.JFrame;

  6: public class TryWindow1
  7: {
  8:     static JFrame window = new JFrame("Window Title"); 

 10:     public static void main(String[] args)
 11:     {
 12:         window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

 14:         //Set position and size, then make visible
 15:         int windowWidth = 400;
 16:         int windowHeight = 150;
 17:         window.setBounds(50, 100, windowWidth, windowHeight);
 18:         window.setVisible(true);
 19:     }
 20: }