-
Notifications
You must be signed in to change notification settings - Fork 2
/
Mathematics.java
75 lines (69 loc) · 1.71 KB
/
Mathematics.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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Mathematics extends JFrame implements ActionListener
{
JButton b1, b2, b3, b4, b5;
public Mathematics()
{
setup();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void setup()
{
setTitle("Mathematics");
setSize(500, 500);
setLayout(new GridLayout(5, 1));
setLocationRelativeTo(null);
b1=new JButton("Add Question");
b2=new JButton("Modify Question");
b3=new JButton("Delete Question");
b4=new JButton("Generate Quiz");
b5=new JButton("Back");
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
}
public void actionPerformed(ActionEvent e)
{
String s=e.getActionCommand();
if(s=="Add Question")
{
dispose();
new AddQuestion("Mathematics");
}
else if(s=="Modify Question")
{
dispose();
new Modify("Mathematics");
}
else if(s=="Delete Question")
{
dispose();
new DeleteQuestion("Mathematics");
}
else if(s=="Generate Quiz")
{
dispose();
new GenerateQuiz("Mathematics");
}
else
{
dispose();
new MenuPage();
}
}
public static void main(String args[])
{
new Mathematics();
}
}