-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframeJavaAwt.java
More file actions
38 lines (30 loc) · 870 Bytes
/
frameJavaAwt.java
File metadata and controls
38 lines (30 loc) · 870 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
37
38
import java.awt.*;
import java.awt.event.*;
import javax.swing.plaf.metal.MetalBorders.TextFieldBorder;
class frameJavaAwt implements ActionListener{
TextField tf;
Button b;
frameJavaAwt(){
Frame f=new Frame();
Label l=new Label("Enter Your Name");
l.setBounds(100,100,200,30);
tf=new TextField();
tf.setBounds(100,130,200,30);
b=new Button("Addition");
b.setBounds(150,200,80,30);
b.addActionListener(this);
f.add(b);
f.add(l);
f.add(tf);
f.setSize(500,500);
f.setTitle("Employee info");
f.setLayout(null);
f.setVisible(true);
}
public void actionPerformed(ActionEvent e){
tf.setText("performed");
}
public static void main(String[] args) {
frameJavaAwt fj=new frameJavaAwt();
}
}