-
Notifications
You must be signed in to change notification settings - Fork 2
/
GUI_AfterLogin.java
97 lines (90 loc) · 2.44 KB
/
GUI_AfterLogin.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
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class GUI_AfterLogin
{
JFrame jf2 = new JFrame("Choose Category");
ImageIcon Ban_pic = new ImageIcon("Bangladesh.png");
JButton Bangladesh = new JButton(Ban_pic);
ImageIcon Tech_pic = new ImageIcon("Tech.png");
JButton Technology = new JButton(Tech_pic);
ImageIcon Sprt_pic = new ImageIcon("Sports.png");
JButton Sports = new JButton(Sprt_pic);
ImageIcon gk_pic = new ImageIcon("gk.png");
JButton General_Knowledge = new JButton(gk_pic);
GUI_AfterLogin()
{
jf2.setSize(750,750);
jf2.setVisible(true);
jf2.setDefaultCloseOperation(jf2.EXIT_ON_CLOSE);
//BoxLayout boxLayout = new BoxLayout(options, BoxLayout.Y_AXIS);
jf2.setLayout(new GridLayout(2,2));
jf2.setLocation(300,10);
// options.setLayout(boxLayout);
jf2.add(Bangladesh);
jf2.add(Technology);
jf2.add(Sports);
jf2.add(General_Knowledge);
jf2.validate();
General_Knowledge.addActionListener(new Handler());
Bangladesh.addActionListener(new Handler());
Technology.addActionListener(new Handler());
Sports.addActionListener(new Handler());
}
class Handler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==Bangladesh)
{
try
{
GUI_Questions page5 = new GUI_Questions("Bangladesh","Bangladesh");
jf2.dispose();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
}
else if(e.getSource()==Sports)
{
try
{
GUI_Questions page5 = new GUI_Questions("Sports","Sports");
jf2.dispose();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
}
else if(e.getSource()==Technology)
{
try
{
GUI_Questions page5 = new GUI_Questions("Technology","Technology");
jf2.dispose();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
}
else if(e.getSource()==General_Knowledge)
{
try
{
GUI_Questions page5 = new GUI_Questions("General_Knowledge","General_Knowledge");
jf2.dispose();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
}
}
}
}