-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu2.java
208 lines (93 loc) · 2.71 KB
/
Menu2.java
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
public class Menu2 extends JPanel
{
static JFrame f = new JFrame("CGPA® App for Project Presentation");
JButton name1 = new JButton("GPA CALCULATOR");
JButton name2 = new JButton("CGPA CALCULATOR");
JButton name4 = new JButton("GENERATE REPORT");
JButton name3 = new JButton("BACK");
Color barColor = new Color(30,195,245);
Image img = new ImageIcon("grade.png").getImage();
Color background = new Color(0,160,216);
public Menu2(){
setLayout(null);
f.setSize(1350,750);
name1.setBounds(900,100,400,100);
name1.setFont(new Font("Dialog", 1, 20));
name1.setHorizontalAlignment(SwingConstants.CENTER);
name1.setBackground(background);
name1.setForeground(Color.white);
add(name1);
name1.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
//Creating new class to show new frame
new GPA();
GPA.f.setVisible(true);
f.setVisible(false);
}
});
name2.setBounds(900,250,400,100);
name2.setFont(new Font("Dialog", 1, 20));
name2.setHorizontalAlignment(SwingConstants.CENTER);
name2.setBackground(background);
name2.setForeground(Color.white);
add(name2);
name2.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
f.setVisible(false);
new CGPA();
}
});
name3.setBounds(900,550,400,100);
name3.setFont(new Font("Dialog", 1, 20));
name3.setHorizontalAlignment(SwingConstants.CENTER);
name3.setBackground(background);
name3.setForeground(Color.white);
add(name3);
name3.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
new Menu();
f.setVisible(false);
}
});
name4.setBounds(900,400,400,100);
name4.setFont(new Font("Dialog", 1, 20));
name4.setHorizontalAlignment(SwingConstants.CENTER);
name4.setBackground(background);
name4.setForeground(Color.white);add(name4);
name4.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
f.setVisible(true);
new Splash2();
}
});
setBackground(new Color(0,80,150));
setBounds(0,0,f.getWidth(), f.getHeight());
f.add(this);
f.setDefaultCloseOperation(3);
f.setVisible(true);
}
public void paintComponent(Graphics g){
super.paintComponent(g);
g.drawImage(img, -50,120,1000,400,this);
}
public static void main(String args[]){
try{
for(javax.swing.UIManager.LookAndFeelInfo info: javax.swing.UIManager.getInstalledLookAndFeels()){
if("Nimbus".equals(info.getName())){
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
}
catch(Exception e){}
new Menu2();
}
}