forked from Rustam-Z/java-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyFrame1.java
More file actions
19 lines (14 loc) · 462 Bytes
/
MyFrame1.java
File metadata and controls
19 lines (14 loc) · 462 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package programs;
import javax.swing.*;
public class MyFrame1 extends JFrame {
public MyFrame1() {
super("MyFrame");
setSize(400, 300); // Set the frame size
setLocationRelativeTo(null); // New since JDK 1 s
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true); // Display the frame
}
public static void main(String[] args) {
MyFrame1 frame = new MyFrame1(); // Create a frame
}
}