1//THIS IS A FIX OF THE ONE BY FRANCY FROG
2//THEY FIXED THEIRS
3import javax.swing.JFrame;
4
5public class example {
6 public static void main(String[] args){
7 JFrame frame = new JFrame();
8 frame.setSize(100,100);
9 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
10 frame.setTitle("Example Frame");
11 frame.setVisible(true);
12 }
13}
1import javax.swing.JFrame;
2
3public class example {
4 public static void main(String[] args){
5 JFrame frame = new JFrame();
6 frame.setSize(100,100);
7 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOES);
8 frame.setTitle("Example Frame");
9 frame.setVisible(true);
10 }
11}
1//1. Create the frame.
2JFrame frame = new JFrame("FrameDemo");
3
4//2. Optional: What happens when the frame closes?
5frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
6
7//3. Create components and put them in the frame.
8//...create emptyLabel...
9frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
10
11//4. Size the frame.
12frame.pack();
13
14//5. Show it.
15frame.setVisible(true);