C:\Users\notebook\Documents\NetBeansProjects\CS2\src\gui\GUI2.java
 1 /*
 2  * GUI2, like GUI1, is a program to create one lonely frame. GUI2, however, 
 3  * establishes a frame class with an eye towards subsequent development.
 4  */
 5 package gui;
 6 
 7 import javax.swing.JFrame;
 8 import javax.swing.SwingUtilities;
 9 
10 /**
11  *
12  * @author notebook
13  */
14 public class GUI2 {
15 
16     /**
17      * @param args the command line arguments
18      */
19     public static void main(String[] args) {
20         SwingUtilities.invokeLater(new ThreadForGUI());
21     }
22 
23     private static class ThreadForGUI implements Runnable {
24 
25         @Override
26         public void run() {
27             GUI2 gui = new GUI2();
28         }
29     }
30 
31     public GUI2() {
32         KFrame frame = new KFrame("GUI 2");
33     }
34 
35     // modeling the featured frame of the GUI
36     private class KFrame extends JFrame {
37 
38         public KFrame(String title) {
39             super(title);
40             setSize(500, 300);
41             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
42             setVisible(true);
43         }
44 
45     }
46 
47 }
48