-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTrailGUI.java
54 lines (46 loc) · 1.41 KB
/
TrailGUI.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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Vector;
/**
* TrailGUI controls the game. It begins at the startPanel and moves forward
* through the other panels and games
*
* @author Zahra Thabet
* @author Nolen Belle Bryant
* @author Giulia Bronzi
* @version 12.17.18
*/
public class TrailGUI
{
Person p;
JPanel trailGame; //a panel that uses CardLayout
Vector<Vector<Situation>> tree;
int counter;
/**
* Creates a new startPanel and begins the game
*
* @param pane ContentPane of TrailGUI object
*/
public void addComponents(Container pane){
JPanel start = new StartPanel();
//Create the panel that contains the "cards".
trailGame = new JPanel(new CardLayout());
trailGame.add(start, "StartPanel");
trailGame.setPreferredSize(new Dimension(1200,800));
trailGame.setBackground(new Color(0,0,0,0));
trailGame.setOpaque(false);
pane.add(trailGame, BorderLayout.CENTER);
}
public static void main (String[] args)
{
JFrame frame = new JFrame("Wellesley Trails");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
TrailGUI game = new TrailGUI();
game.addComponents(frame.getContentPane());
//Display the window.
frame.pack();
frame.setVisible(true);
}
}