-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclalc.java
More file actions
35 lines (34 loc) · 1.37 KB
/
clalc.java
File metadata and controls
35 lines (34 loc) · 1.37 KB
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
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class clalc extends JFrame
{
JLabel l;
public void start()
{ l=new JLabel();
l.setText(" Name :");
JTextField txt=new JTextField();
txt.setText("");
JPasswordField ps=new JPasswordField(10);
JButton but=new JButton();
but.setText("Submit");
add(l);
add(txt);
add(ps);
add(but);
but.addActionListener( new ActionListener()
{ public void actionPerformed( ActionEvent e)
{ l.setText("Button clicked");
} } );
setLayout(new FlowLayout());
setSize(400,400); setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String args[])
{ new clalc().start();
} }