-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactionlistener.java
More file actions
38 lines (30 loc) · 886 Bytes
/
actionlistener.java
File metadata and controls
38 lines (30 loc) · 886 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.Button;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class actionlistener extends Frame implements ActionListener {
Label lb;
Button b;
public actionlistener(){
this.setVisible(true);
this.setSize(500,500);
b= new Button("click here");
b.setBounds(200, 200, 60, 30);
this.add(b);
lb= new Label();
lb.setBounds(100, 100, 300, 50);
this.add(lb);
b.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
Font f= new Font("consolas", 1, 25);
lb.setFont(f);
lb.setText("welcome back");
}
public static void main(String[] args) {
new actionlistener();
}
}