forked from fayecamilleburi/TopologicalSort
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGender.java
More file actions
154 lines (128 loc) · 4.73 KB
/
Gender.java
File metadata and controls
154 lines (128 loc) · 4.73 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
145
146
147
148
149
150
151
152
153
154
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Gender extends JFrame implements ActionListener {
private JButton optionOne, optionTwo;
private JButton backButton, exitButton;
public Gender() {
initComponents();
}
private void initComponents() {
setTitle("GRWM");
setSize(new Dimension(1280, 720));
setResizable(false);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
add(headerPanel());
add(contentPanel());
}
public JPanel contentPanel() {
JPanel panel = new JPanel(null);
panel.setBounds(0, 80, 1280, 640);
panel.setBackground(new Color(0xEFE7DD));
add(optionChoices());
return panel;
}
public JPanel headerPanel() {
JPanel panel = new JPanel(null);
panel.setSize(1280, 80);
panel.setBackground(new Color(0x5C3420));
JLabel header = new JLabel("Getting Dressed for School");
header.setBounds(0, 15, 1280, 30);
header.setForeground(Color.WHITE);
header.setFont(new Font("Arial", Font.BOLD, 25));
header.setHorizontalAlignment(JLabel.CENTER);
panel.add(header);
JLabel subtext = new JLabel("using Variable-Size-Decrease");
subtext.setBounds(0, 43, 1280, 20);
subtext.setForeground(Color.WHITE);
subtext.setFont(new Font("Arial", Font.ITALIC, 12));
subtext.setHorizontalAlignment(JLabel.CENTER);
panel.add(subtext);
backButton = new JButton("Back");
backButton.setBounds(20, 20, 100, 40);
backButton.setBackground(new Color(0x9B4922));
backButton.setForeground(Color.WHITE);
backButton.addActionListener(this::actionPerformedBack);
backButton.setFocusable(false);
panel.add(backButton);
exitButton = new JButton("Exit");
exitButton.setBounds(1150, 20, 100, 40);
exitButton.setBackground(new Color(0x9B4922));
exitButton.setForeground(Color.WHITE);
exitButton.addActionListener(this::actionPerformedExit);
exitButton.setFocusable(false);
panel.add(exitButton);
return panel;
}
public void actionPerformedBack(ActionEvent e) {
if (e.getSource() == backButton) {
SwingUtilities.invokeLater(() -> {
new Choices().setVisible(true);
});
dispose();
}
}
public void actionPerformedExit(ActionEvent e) {
if (e.getSource() == exitButton) {
SwingUtilities.invokeLater(() -> {
new Credits().setVisible(true);
});
}
}
public JPanel optionChoices() {
JPanel panel = new JPanel(null);
panel.setBounds(30, 230, 1200, 360);
panel.setBackground(new Color(0xEFE7DD));
JLabel intro = new JLabel("Select Gender");
intro.setBounds(0, 10, 1200, 30);
intro.setForeground(new Color(0x9B4922));
intro.setFont(new Font("Arial", Font.ITALIC, 30));
intro.setHorizontalAlignment(JLabel.CENTER);
panel.add(intro);
optionOne = new JButton("Male");
optionOne.setBounds(375, 70, 195, 50);
optionOne.setBackground(new Color(0x5C3420));
optionOne.setForeground(Color.WHITE);
optionOne.setFont(new Font("Arial", Font.BOLD, 13));
optionOne.setFocusable(false);
optionOne.addActionListener(this);
panel.add(optionOne);
JLabel or = new JLabel("or");
or.setBounds(575, 70, 50, 50);
or.setForeground(new Color(0x9B4922));
or.setFont(new Font("Arial", Font.ITALIC, 30));
or.setHorizontalAlignment(JLabel.CENTER);
panel.add(or);
optionTwo = new JButton("Female");
optionTwo.setBounds(635, 70, 195, 50);
optionTwo.setBackground(new Color(0x5C3420));
optionTwo.setForeground(Color.WHITE);
optionTwo.setFont(new Font("Arial", Font.BOLD, 13));
optionTwo.setFocusable(false);
optionTwo.addActionListener(this::actionPerformedTwo);
panel.add(optionTwo);
return panel;
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == optionOne) {
dispose();
SwingUtilities.invokeLater(() -> {
new VSD_UI_MALE().setVisible(true);
});
}
}
public void actionPerformedTwo(ActionEvent e) {
if (e.getSource() == optionTwo) {
dispose();
SwingUtilities.invokeLater(() -> {
new VSD_UI_FEMALE().setVisible(true);
});
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
new Gender().setVisible(true);
});
}
}