-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpen_Contests.java
More file actions
38 lines (32 loc) · 2.13 KB
/
Copy pathOpen_Contests.java
File metadata and controls
38 lines (32 loc) · 2.13 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
public class ContestPanel extends JPanel {
public ContestPanel() {
setLayout(new BorderLayout());
JLabel contestLabel = new JLabel("Current Contests", JLabel.CENTER);
contestLabel.setFont(new Font("Arial", Font.BOLD, 20));
add(contestLabel, BorderLayout.NORTH);
JTextArea contestDetails = new JTextArea(20, 50);
contestDetails.setText(getContestDescriptions());
add(new JScrollPane(contestDetails), BorderLayout.CENTER);
JButton enterContestButton = new JButton("Enter Contest");
enterContestButton.addActionListener(e -> showContestForm());
add(enterContestButton, BorderLayout.SOUTH);
JButton backButton = new JButton("Back to Home");
backButton.addActionListener(e -> MainApp.cardLayout.show(MainApp.mainPanel, "Home"));
add(backButton, BorderLayout.SOUTH);
}
private String getContestDescriptions() {
return "Contest 1: Repurposed Compute, Wasted Compute, or Innovation via Component Dismantling\n" +
"Description: Can you build something worthwhile out of things broken, old, or being thrown away? " +
"Can you build something computing with an unused resource, like the wind, existing DNS infrastructure, or magnetic fields?\n" +
"Prize: $1,000 USD cash, company stock, a part-time or full-time job offer.\n" +
"To be disseminated to high schools but open to the general public, no matter the age.\n\n" +
"Contest 2: Artisanal Technological Innovation\n" +
"Description: Lightweight, mini-turbine designs (metal or ceramics or whatever), preferably taking gas from one side and liquid from the other.\n" +
"Prize: $1,000 USD cash, company stock, a part-time or full-time job offer.\n" +
"To be disseminated among fine arts schools and universities.\n";
}
private void showContestForm() {
JFrame contestForm = new JFrame("Enter Contest");
contestForm.setSize(400, 300);
contestForm.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JPanel form