-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShuttle_Window.java
More file actions
61 lines (51 loc) · 2.07 KB
/
Shuttle_Window.java
File metadata and controls
61 lines (51 loc) · 2.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Shuttle_Window.java
* Kevin Aka
* 12-20-23
*
* CS 86 Homework 7
*
* This file tells the program to make the middle area of the screen the place
* where the buses are drawn and moves. And it tells program to divide the rest
* of the screen into 4 sections. 3 of these sections will hold buttons that
* control what happens in the middle area of the screen, while the top section
* will state if the user won or not at the end of the game.
*
*/
import java.awt.*;
import javax.swing.*;
public class Shuttle_Window extends JFrame {
public Shuttle_Window(){
Canvas shuttle_map = new Canvas();
shuttle_map.setLayout(new FlowLayout());
shuttle_map.setBorder(BorderFactory.createLineBorder(Color.RED));
shuttle_map.setPreferredSize(new Dimension(450,450));
add(shuttle_map, BorderLayout.CENTER);
pack();
//add control panels
Control_Panel1 control_panel1 = new Control_Panel1(shuttle_map);
control_panel1.setLayout(new FlowLayout());
control_panel1.setBorder(BorderFactory.createLineBorder(Color.black));
control_panel1.setPreferredSize(new Dimension(250,250));
add(control_panel1, BorderLayout.EAST);
pack();
Control_Panel2 control_panel2 = new Control_Panel2(shuttle_map);
control_panel2.setLayout(new FlowLayout());
control_panel2.setBorder(BorderFactory.createLineBorder(Color.black));
control_panel2.setPreferredSize(new Dimension(250,250));
add(control_panel2, BorderLayout.WEST);
pack();
Control_Panel3 control_panel3 = new Control_Panel3(shuttle_map);
control_panel3.setLayout(new FlowLayout());
control_panel3.setBorder(BorderFactory.createLineBorder(Color.black));
control_panel3.setPreferredSize(new Dimension(200,200));
add(control_panel3, BorderLayout.SOUTH);
pack();
Control_Panel4 control_panel4 = new Control_Panel4(shuttle_map);
control_panel4.setLayout(new FlowLayout());
control_panel4.setBorder(BorderFactory.createLineBorder(Color.black));
control_panel4.setPreferredSize(new Dimension(200,200));
add(control_panel4, BorderLayout.NORTH);
pack();
}
}