-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTourneyTimerView.java
49 lines (41 loc) · 1.18 KB
/
TourneyTimerView.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
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
/**
* GUI for the Tourney Timer
*/
public class TourneyTimerView extends JFrame{
/**
* Title, Timer label, and Button for the basic timer.
*/
private JLabel title = new JLabel("Tournament Timer", SwingConstants.CENTER);
private JLabel timer = new JLabel("", SwingConstants.CENTER);
private JButton enterTimeButton = new JButton("Set Time");
/**
* Constructs the GUI using class components
*/
public TourneyTimerView()
{
JPanel timerpanel = new JPanel();
timerpanel.setLayout(new BorderLayout());
timerpanel.add(title, BorderLayout.PAGE_START);
timerpanel.add(timer, BorderLayout.CENTER);
timerpanel.add(enterTimeButton, BorderLayout.PAGE_END);
timer.setFont(new Font("Serif", Font.BOLD, 125));
this.add(timerpanel);
setSize(400,200);
setLocationRelativeTo(null);
setVisible(true);
}
/**
* getters and setters for components
*/
public JButton getEnterTimeButton()
{
return enterTimeButton;
}
public JLabel getTimer()
{
return timer;
}
}