-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.java
More file actions
36 lines (26 loc) · 757 Bytes
/
app.java
File metadata and controls
36 lines (26 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gui; //Put it in a folder called gui (all lower case) or change it
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class app {
public static void main(String[] args) {
JFrame frame = new JFrame();
// Text
JLabel text = new JLabel();
text.setText("Wowie you did it!!");
text.setLocation(0, 0);
frame.add(text);
// Frame size
frame.setPreferredSize(new Dimension(500, 400));
frame.setSize(800, 700);
frame.setMinimumSize(new Dimension(500,400));
// Other frame stuff
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.setBackground(Color.BLACK);
// Frame basics
frame.setTitle("Welcome to this app");
// Labels
}
}