-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppPassword.java
More file actions
54 lines (47 loc) · 1.14 KB
/
Copy pathAppPassword.java
File metadata and controls
54 lines (47 loc) · 1.14 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class AppPassword extends Applet implements ActionListener
{
Button b;
Label l;
TextField tf;
Image i;
Label l1;
public void init()
{
b = new Button("Enter");
l = new Label("Enter the Password : ", Label.LEFT);
l1 = new Label("");
tf = new TextField(25);
tf.setEchoChar('*');
i = getImage(getCodeBase(), "welcome.gif");
}
public void paint(Graphics g)
{
if (l1.getText().equals("WELCOME"))
g.drawImage(i, 575, 175, this);
}
public void start()
{
setBackground(Color.green);
add(l);
add(tf);
add(b);
b.addActionListener(this);
add(l1);
}
public void actionPerformed(ActionEvent e)
{
if(tf.getText().equals("1234"))
{
showStatus("Correct");
l1.setText("WELCOME");
}
else
{
showStatus("Wrong");
l1.setText("WRONG");
}
}
}