1package Exaple;
2
3import java.awt.Color;
4
5import javax.swing.JFrame;
6
7public class Window {
8
9 public static void main(String[] args) {
10
11 JFrame frame = new JFrame();
12 frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
13 frame.setVisible(true);
14 frame.setTitle("Expaple");
15 frame.setBackground(Color.BLUE);
16 }
17
18}
1import java.awt.Color;
2import java.awt.Dimension;
3import javax.swing.JFrame;
4public class SwingDemo {
5 public static void main(String[] args) {
6 JFrame frame = new JFrame();
7 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
8 frame.setPreferredSize(new Dimension(550, 300));
9 frame.getContentPane().setBackground(Color.BLUE);
10 frame.pack();
11 frame.setVisible(true);
12 }
13}