-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_menu.java
More file actions
144 lines (113 loc) · 4.24 KB
/
main_menu.java
File metadata and controls
144 lines (113 loc) · 4.24 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
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
package mathPractice;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.awt.Image;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.awt.SystemColor;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextField;
public class main_menu {
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
main_menu window = new main_menu();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
private int counter;
String name;
public main_menu() {
initialize();
}
public int getCounter() {
return counter;
}
public void setCounter(int counter) {
this.counter = counter;
}
private void initialize() {
addition AFrame = new addition();
Multiply MFrame = new Multiply();
Subtraction SFrame = new Subtraction();
frame = new JFrame();
frame.getContentPane().setBackground(new Color(255, 250, 205));
frame.setBounds(100, 100, 650, 525);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
Image Images = new ImageIcon(this.getClass().getResource("/add1.png")).getImage();
JLabel lblNewLabel = new JLabel("Select a concept to practice");
lblNewLabel.setForeground(new Color(0, 128, 0));
lblNewLabel.setBackground(new Color(0, 128, 0));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 29));
lblNewLabel.setBounds(111, 42, 400, 35);
Image Images1 = new ImageIcon(this.getClass().getResource("/multiply.png")).getImage();
frame.getContentPane().add(lblNewLabel);
JButton btnNewButton_1 = new JButton("");
btnNewButton_1.setBackground(new Color(127, 255, 0));
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
MFrame.setVisible(true);
}
});
btnNewButton_1.setHorizontalAlignment(SwingConstants.CENTER);
btnNewButton_1.setIcon(new ImageIcon(Images1));
btnNewButton_1.setFont(new Font("Verdana", Font.PLAIN, 22));
btnNewButton_1.setBounds(344, 138, 250, 150);
frame.getContentPane().add(btnNewButton_1);
JButton optionAdd = new JButton("+");
optionAdd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
AFrame.setVisible(true);
}
});
optionAdd.setBackground(new Color(0, 255, 0));
optionAdd.setForeground(SystemColor.textText);
optionAdd.setHorizontalAlignment(SwingConstants.CENTER);
// optionAdd.setIcon(new ImageIcon(Images));
optionAdd.setFont(new Font("Verdana", Font.PLAIN, 90));
optionAdd.setBounds(34, 138, 250, 150);
frame.getContentPane().add(optionAdd);
JButton btnNewButton_1_1_1 = new JButton("-");
btnNewButton_1_1_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
SFrame.setVisible(true);
}
});
btnNewButton_1_1_1.setHorizontalAlignment(SwingConstants.CENTER);
btnNewButton_1_1_1.setForeground(SystemColor.textText);
btnNewButton_1_1_1.setFont(new Font("Verdana", Font.PLAIN, 90));
btnNewButton_1_1_1.setBackground(Color.GREEN);
btnNewButton_1_1_1.setBounds(34, 314, 250, 150);
frame.getContentPane().add(btnNewButton_1_1_1);
JButton btnNewButton_1_1_2 = new JButton("Under \r\n\r\n\r\n\r\nConstruction ;/");
btnNewButton_1_1_2.setHorizontalAlignment(SwingConstants.LEADING);
btnNewButton_1_1_2.setForeground(new Color(255, 204, 0));
btnNewButton_1_1_2.setFont(new Font("Verdana", Font.PLAIN, 19));
btnNewButton_1_1_2.setBackground(Color.GREEN);
btnNewButton_1_1_2.setBounds(344, 314, 250, 150);
frame.getContentPane().add(btnNewButton_1_1_2);
JLabel lblAuthor = new JLabel("Author : Anish K.");
lblAuthor.setBounds(10, 11, 185, 14);
frame.getContentPane().add(lblAuthor);
}
}