-
Notifications
You must be signed in to change notification settings - Fork 0
/
OptionGUI.java
61 lines (48 loc) · 1.26 KB
/
OptionGUI.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
import javax.swing.*;
import java.util.ArrayList;
import java.awt.*;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
public class OptionGUI extends JPanel
{
AnnouncementGUI announcement;
LaunchGameGUI launch;
RankGUI rank_and_info;
LoadFile player_data;
ArrayList<Player> data = new ArrayList<Player>();
private GridBagConstraints gbc = new GridBagConstraints();
// constructor that initializes the panels
public OptionGUI()
{
announcement = new AnnouncementGUI();
launch = new LaunchGameGUI();
player_data = new LoadFile();
data = player_data.loadPlayer("player_data.txt");
RankGUI rank_and_info = new RankGUI(data);
setLayout(new GridBagLayout());
gbc.gridx = 0;
gbc.gridy = 0;
add(announcement, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
add(launch, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
add(rank_and_info, gbc);
setPreferredSize(new Dimension(120, 320));
}
// returns the announcementGUI
public AnnouncementGUI getAnnouncementGUI()
{
return announcement;
}
// sets a GameControl
public void setControl(GameControl c)
{
launch.setControl(c);
}
public ArrayList<Player> getData()
{
return data;
}
}