-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyFrame2.java
More file actions
67 lines (58 loc) · 1.52 KB
/
MyFrame2.java
File metadata and controls
67 lines (58 loc) · 1.52 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
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.lang.*;
import javax.swing.JFrame;
public class MyFrame2 extends Frame
{
JButton b1, b2, b3;
TextField t1, t2, t3, t4;
MyActionListener ml;
MyFrame2()
{
setLayout(null);
ml = new MyActionListener(this);
JButton b1 = new JButton("AddStud");
b1.setIcon(new ImageIcon(this.getClass().getResource("Images/signupb1.png")));
b1.setBounds(635,666,326,56);
add(b1);
b1.addActionListener(ml);
JButton b2=new JButton("homepg");
b2.setBackground(Color. WHITE);
b2.setIcon(new ImageIcon(this.getClass().getResource("Images/signhome.png")));
b2.setBounds(28,0,48,50);
add(b2);
b2.addActionListener(ml);
JButton b3 = new JButton("shut");
b3.setIcon(new ImageIcon(this.getClass().getResource("Images/signshut.png")));
b3.setBounds(1532,750,48,54);
add(b3);
b3.addActionListener(ml);
t1 = new TextField();
t2 = new TextField();
t3 = new TextField();
t4 = new TextField();
t1.setBounds(635,266,326,56);
t2.setBounds(635,370,326,56);
t3.setBounds(635,472,326,56);
t4.setBounds(635,576,326,56);
add(t1);
add(t2);
add(t3);
add(t4);
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/add.png");
g.drawImage(i, 0, 0,this);
}
}