C:\Users\notebook\Documents\NetBeansProjects\CS2\src\gui\GUI1.java |
1
2
3
4 package gui;
5
6 import javax.swing.JFrame;
7 import javax.swing.SwingUtilities;
8
9
10
11 @author
12
13 public class GUI1 {
14
15
16 @param args
17
18 public static void main(String[] args) {
19 SwingUtilities.invokeLater(new ThreadForGUI());
20 }
21
22 private static class ThreadForGUI implements Runnable {
23
24 public ThreadForGUI() {
25 }
26
27 @Override
28 public void run() {
29 GUI1 gui = new GUI1();
30 }
31 }
32
33 public GUI1() {
34 JFrame frame = new JFrame("GUI 1");
35 frame.setSize(500, 300);
36 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
37 frame.setVisible(true);
38 }
39
40 }
41