This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexFrame2020.java
123 lines (91 loc) · 3.2 KB
/
IndexFrame2020.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
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
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class IndexFrame2020 extends JFrame implements ActionListener{
String teamNumberRawData;
String teamNumberRobotType;
static JButton backButton;
static JButton rawDataButton;
static JButton robotTypeButton;
static JButton Pointranking;
static JButton rawDataAllButton;
static JButton notesButton;
static JTextField robotTypetextfield;
static JTextField rawDatatextfield;
IndexFrame2020() {
//back
backButton = new JButton();
backButton.setBounds(20, 20, 100, 25);
backButton.setText("Back");
backButton.addActionListener(this);
//raw data
rawDataButton = new JButton();
rawDataButton.setBounds(900, 200, 100, 50);
rawDataButton.setText("Specific Team");
rawDataButton.addActionListener(this);
//all raw data
rawDataAllButton = new JButton();
rawDataAllButton.setBounds(1050, 200, 100, 50);
rawDataAllButton.setText("All Data");
rawDataAllButton.addActionListener(this);
//raw data text field
rawDatatextfield = new JTextField();
rawDatatextfield.setBounds(650, 200, 200, 50);
//line 2: robot Type button
robotTypeButton = new JButton();
robotTypeButton.setBounds(900, 275, 200, 50);
robotTypeButton.setText("Robot Type");
robotTypeButton.addActionListener(this);
//robot Type text field
robotTypetextfield = new JTextField();
robotTypetextfield.setBounds(650, 275, 200, 50);
//line 3: point ranking
Pointranking = new JButton();
Pointranking.setBounds(650, 350, 200, 50);
Pointranking.setText("Point Ranking");
Pointranking.addActionListener(this);
//notes button
notesButton = new JButton();
notesButton.setBounds(650, 425, 200, 50);
notesButton.setText("Notes");
notesButton.addActionListener(this);
this.setTitle("WVR Scouting App: Index Frame 2020"); // Titles the Window
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // When the X is clicked, the window closes
this.setResizable(false); // Keeps a consistent window size.
this.setSize(1200,600); // In pixels, the size of the widow. (width x height)
this.setVisible(true); // Makes the frame visible
Color customColor = new Color(93, 188, 210); //Creates a background color
this.getContentPane().setBackground(customColor);
this.setLayout(null);
this.add(backButton);
this.add(rawDataButton);
this.add(rawDataAllButton);
this.add(rawDatatextfield);
this.add(robotTypeButton);
this.add(robotTypetextfield);
this.add(Pointranking);
this.add(notesButton);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource()==backButton) {
this.dispose();
MainFrame mainframe = new MainFrame();
}
if (e.getSource()==rawDataButton) {
teamNumberRawData = rawDatatextfield.getText();
System.out.println(rawDatatextfield.getText());
rawDatatextfield.setText(" ");
}
if (e.getSource()==robotTypeButton) {
teamNumberRobotType = robotTypetextfield.getText();
System.out.println(robotTypetextfield.getText());
robotTypetextfield.setText(" ");
}
}
}