-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyFrame4.java
More file actions
73 lines (62 loc) · 1.71 KB
/
MyFrame4.java
File metadata and controls
73 lines (62 loc) · 1.71 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.lang.*;
import javax.swing.JFrame;
public class MyFrame4 extends Frame
{
JButton b1, b2;
TextField t1, t2;
Font f1;
MyActionListener ml;
MyFrame4()
{
setLayout(null);
ml = new MyActionListener(this);
t1 = new TextField();
t1.setBounds(200,236,370,56);
add(t1);
t2 = new TextField();
t2.setBounds(200,478,370,56);
add(t2);
Font f1 = new Font("Comic Sans MS",Font.BOLD,30);
t1.setFont(f1);
t2.setFont(f1);
JButton b1=new JButton("generate");
b1.setIcon(new ImageIcon(this.getClass().getResource("Images/gen.png")));
b1.setBounds(200,345,370,56);
add(b1);
b1.setVisible(true);
b1.addActionListener(ml);
JButton b2=new JButton("verify");
b2.setIcon(new ImageIcon(this.getClass().getResource("Images/ver.png")));
b2.setBounds(200,594,370,56);
add(b2);
b2.setVisible(true);
b2.addActionListener(ml);
JButton b3=new JButton("homepg");
b3.setIcon(new ImageIcon(this.getClass().getResource("Images/otphome.png")));
b3.setBounds(28,0,48,50);
add(b3);
b3.addActionListener(ml);
JButton b4 = new JButton("shut");
b4.setIcon(new ImageIcon(this.getClass().getResource("Images/otpshut.png")));
b4.setBounds(1532,750,48,54);
add(b4);
b4.addActionListener(ml);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}
public void paint(Graphics g)
{
Toolkit t=Toolkit.getDefaultToolkit();
Image i=t.getImage("Images/otp.png");
g.drawImage(i, 0, 0,this);
}
}