-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicAWTFrame.java
More file actions
35 lines (29 loc) · 788 Bytes
/
BasicAWTFrame.java
File metadata and controls
35 lines (29 loc) · 788 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
package AWTAPI;
import java.awt.*;
class MyFrame extends Frame{
Label label;
Button button;
TextField textField;
TextArea textArea;
MyFrame(){
super("Java AWT API");
setLayout(new FlowLayout());
label = new Label("Project");
textField = new TextField(20);
button = new Button("Submit");
textArea = new TextArea("Remark",5,70,2);
add(label);
add(textField);
add(button);
add(textArea);
}
}
public class Main {
public static void main(String[] args) {
System.out.println("---------Learning AWT API---------");
MyFrame frame = new MyFrame();
frame.setBackground(Color.LIGHT_GRAY);
frame.setSize(800,500);
frame.setVisible(true);
}
}