-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
209 lines (166 loc) · 9.84 KB
/
Main.java
File metadata and controls
209 lines (166 loc) · 9.84 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
import javax.swing.*; //imports
import java.awt.event.ActionEvent; //imports
import java.awt.event.ActionListener; //imports
import java.awt.GridLayout; //imports
public class Main extends JFrame implements ActionListener { // create class with JFrame and ActionListener
private static final long serialVersionUID = 1L; // TODO find out what the heck this does
public static void main(final String[] args) { // Main method
String filepath = "t1_be_back.wav";
Music musicObject = new Music();
JFrame frame;
JButton button1, button2, button3, button4, button5, button6, button7, button8, button9, button10, button11, button12, button13, button14, button15, button16; //Create buttons
JPanel panel1, panel2, panel3, panel4, panel5, panel6, panel7, panel8, panel9, panel10, panel11, panel12, panel13, panel14, panel15, panel16; //Create panels
frame = new JFrame("Soundboard"); //Create the window of the soundboard
button1 = new JButton("test"); //Button creation
button2 = new JButton("I'll be back"); //Button creation
button3 = new JButton("I'll be back"); //Button creation
button4 = new JButton("I'll be back"); //Button creation
button5 = new JButton("I'll be back"); //Button creation
button6 = new JButton("I'll be back"); //Button creation
button7 = new JButton("I'll be back"); //Button creation
button8 = new JButton("I'll be back"); //Button creation
button9 = new JButton("I'll be back"); //Button creation
button10 = new JButton("I'll be back"); //Button creation
button11 = new JButton("I'll be back"); //Button creation
button12 = new JButton("I'll be back"); //Button creation
button13 = new JButton("I'll be back"); //Button creation
button14 = new JButton("I'll be back"); //Button creation
button15 = new JButton("I'll be back"); //Button creation
button16 = new JButton("I'll be back"); //Button creation
panel1 = new JPanel(); //Panel Creation
panel2 = new JPanel(); //Panel Creation
panel3 = new JPanel(); //Panel Creation
panel4 = new JPanel(); //Panel Creation
panel5 = new JPanel(); //Panel Creation
panel6 = new JPanel(); //Panel Creation
panel7 = new JPanel(); //Panel Creation
panel8 = new JPanel(); //Panel Creation
panel9 = new JPanel(); //Panel Creation
panel10 = new JPanel(); //Panel Creation
panel11 = new JPanel(); //Panel Creation
panel12 = new JPanel(); //Panel Creation
panel13 = new JPanel(); //Panel Creation
panel14= new JPanel(); //Panel Creation
panel15= new JPanel(); //Panel Creation
panel16= new JPanel(); //Panel Creation
button1.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button2.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button3.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button4.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button5.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button6.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button7.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button8.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button9.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button10.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button11.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button12.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button13.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button14.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button15.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
button16.addActionListener(new ActionListener() { // Add the ActionListener to the JButton
public void actionPerformed(final ActionEvent e) { // Create method to do when JButton is pressed
musicObject.playMusic(filepath);
}
});
panel1.add(button1); //Add button to panel
panel2.add(button2); //Add button to panel
panel3.add(button3); //Add button to panel
panel4.add(button4); //Add button to panel
panel5.add(button5); //Add button to panel
panel6.add(button6); //Add button to panel
panel7.add(button7); //Add button to panel
panel8.add(button8); //Add button to panel
panel9.add(button9); //Add button to panel
panel10.add(button10); //Add button to panel
panel11.add(button11); //Add button to panel
panel12.add(button12); //Add button to panel
panel13.add(button13); //Add button to panel
panel14.add(button14); //Add button to panel
panel15.add(button15); //Add button to panel
panel16.add(button16); //Add button to panel
frame.add(panel1); //Add panel to frame
frame.add(panel2); //Add panel to frame
frame.add(panel3); //Add panel to frame
frame.add(panel4); //Add panel to frame
frame.add(panel5); //Add panel to frame
frame.add(panel6); //Add panel to frame
frame.add(panel7); //Add panel to frame
frame.add(panel8); //Add panel to frame
frame.add(panel9); //Add panel to frame
frame.add(panel10); //Add panel to frame
frame.add(panel11); //Add panel to frame
frame.add(panel12); //Add panel to frame
frame.add(panel13); //Add panel to frame
frame.add(panel4); //Add panel to frame
frame.add(panel15); //Add panel to frame
frame.add(panel16); //Add panel to frame
frame.setLayout(new GridLayout(0,3));
frame.setSize(400, 400); // Set the size of the JFrame
frame.setLocation(300, 100); // Set the location of the JFrame
frame.setVisible(true); // Make the JFrame visable
}
@Override
public void actionPerformed(final ActionEvent e) { // TODO find out what the heck frick this does
}
}