Source of TestGUISwing2.java


  1: //TestGUISwing2.java
  2: //Just create and show a JFrame.
  3: //Size is determined by setting a specific width and height.

  5: import java.awt.*;
  6: import javax.swing.*;

  8: public class TestGUISwing2
  9: {
 10:     public static void main(String[] args)
 11:     {
 12:         JFrame frame = new JFrame("My JFrame");
 13:         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

 15:         frame.setSize(600, 300);
 16:         frame.setVisible(true);
 17:         //frame.show();  //Can use this line in place of one above.
 18:     }
 19: }