-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFire.java
More file actions
130 lines (107 loc) · 3.13 KB
/
Copy pathFire.java
File metadata and controls
130 lines (107 loc) · 3.13 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package AI_Project;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class Fire extends JFrame {
JPanel parent, child, easypanel, hardpanel;
JButton easy, hard,exit,instruction;
JLabel l2,l3,l4,l5;
Fire() {
parent = new JPanel();
parent.setBackground(Color.YELLOW);
add(parent);
child = new JPanel();
child.setPreferredSize(new Dimension(500, 300));
child.setBackground(Color.YELLOW);
GridBagConstraints gbc = new GridBagConstraints();
GridBagLayout l = new GridBagLayout();
child.setLayout(l);
gbc.gridx = 0;
gbc.gridy = 0;
JLabel l1 = new JLabel(" !!! FIRE !!!");
l1.setFont(new Font("Times New Roman", Font.BOLD, 40));
l1.setPreferredSize(new Dimension(250, 70));
child.add(l1, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
JLabel l2 = new JLabel();
l2.setPreferredSize(new Dimension(220, 5));
child.add(l2, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
easy = new JButton("EASY");
easy.setFont(new Font("Times New Roman", Font.BOLD, 14));
easy.setPreferredSize(new Dimension(130, 30));
easy.setBackground(Color.white);
easy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
gamemode p = new gamemode(parent,1,child);
}
});
child.add(easy, gbc);
gbc.gridx = 0;
gbc.gridy = 3;
l3= new JLabel();
l3.setPreferredSize(new Dimension(220, 5));
child.add(l3, gbc);
gbc.gridx = 0;
gbc.gridy = 4;
hard = new JButton("HARD");
hard.setFont(new Font("Times New Roman", Font.BOLD, 14));
hard.setPreferredSize(new Dimension(130, 30));
hard.setBackground(Color.white);
hard.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gamemode p = new gamemode(parent,2,child);
}
});
child.add(hard, gbc);
gbc.gridx = 0;
gbc.gridy = 5;
l4= new JLabel();
l4.setPreferredSize(new Dimension(220,5));
child.add(l4, gbc);
gbc.gridx = 0;
gbc.gridy = 6;
instruction = new JButton("Instruction");
instruction.setFont(new Font("Times New Roman", Font.BOLD, 14));
instruction.setPreferredSize(new Dimension(130, 30));
instruction.setBackground(Color.white);
instruction.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Instruction inst = new Instruction(parent,child);
}
});
child.add(instruction, gbc);
gbc.gridx = 0;
gbc.gridy = 7;
l5 = new JLabel();
l5.setPreferredSize(new Dimension(220, 5));
child.add(l5, gbc);
gbc.gridx = 0;
gbc.gridy = 8;
exit = new JButton("EXIT");
exit.setFont(new Font("Times New Roman", Font.BOLD, 14));
exit.setPreferredSize(new Dimension(130, 30));
exit.setBackground(Color.white);
exit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
child.add(exit, gbc);
parent.add(child);
}
}