-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPitchPanel.java
More file actions
38 lines (32 loc) · 1.07 KB
/
Copy pathPitchPanel.java
File metadata and controls
38 lines (32 loc) · 1.07 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
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;
/*
* Monica Anuforo, Sharman Tan, Tara Iyer
*/
import javax.swing.JButton;
import javax.swing.JPanel;
public class PitchPanel extends JPanel {
private static final long serialVersionUID = -5107785666165487335L;
public PitchPanel(ActionListener algoChangeListener){
super(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
createButtons(algoChangeListener, c);
}
// Creates Start and End Buttons
private void createButtons(ActionListener algoChangeListener, GridBagConstraints c) {
JButton startButton = new JButton("START");
c.gridx = 0;
c.gridy = 0;
startButton.setBackground(new Color(0, 200, 120));
startButton.setContentAreaFilled(false);
startButton.setOpaque(true);
startButton.setForeground(Color.white);
startButton.setActionCommand("START");
startButton.addActionListener(algoChangeListener);
add(startButton, c);
}
// Private Instance variables
private JButton startButton, endButton;
}