Skip to content

Commit 0225fde

Browse files
Add files via upload
1 parent edd770e commit 0225fde

5 files changed

Lines changed: 57 additions & 0 deletions

File tree

checkJava.class

1017 Bytes
Binary file not shown.

checkJava.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
class checkJava extends Frame implements ActionListener{
4+
TextField tf;
5+
checkJava(){
6+
tf=new TextField();
7+
tf.setBounds(165,60,200,20);// here 165 is x axis, 60 is y axis,100 is width and 20 is height of text field
8+
Button b=new Button("Submit");
9+
b.setBounds(220,120,80,30);
10+
11+
b.addActionListener(this);
12+
13+
add(b);
14+
add(tf);
15+
setSize(500,500);
16+
setLayout(null);
17+
setVisible(true);
18+
}
19+
public void actionPerformed(ActionEvent e){
20+
tf.setText("Welcome By: Harendra");
21+
}
22+
public static void main(String[] args) {
23+
new checkJava();
24+
}
25+
26+
27+
}

javaEventHandeling.class

-9 Bytes
Binary file not shown.

newJavaButton.class

1.14 KB
Binary file not shown.

newJavaButton.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
class newJavaButton extends Frame implements ActionListener{
4+
TextField tf;
5+
newJavaButton(){
6+
Label l=new Label("It will change Dynamically");
7+
l.setBounds(165,30,200,20);
8+
tf=new TextField();
9+
tf.setBounds(165,60,200,20);// here 165 is x axis, 60 is y axis,100 is width and 20 is height of text field
10+
Button b=new Button("Submit");
11+
b.setBounds(220,120,80,30);
12+
13+
b.addActionListener(this);
14+
add(l);
15+
add(b);
16+
add(tf);
17+
setSize(500,500);
18+
setLayout(null);
19+
setVisible(true);
20+
setTitle("Hey.. awt");
21+
}
22+
public void actionPerformed(ActionEvent e){
23+
tf.setText("hello harendra");
24+
}
25+
public static void main(String[] args) {
26+
new newJavaButton();
27+
}
28+
29+
30+
}

0 commit comments

Comments
 (0)