-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameFrame.java
More file actions
85 lines (67 loc) · 3.19 KB
/
GameFrame.java
File metadata and controls
85 lines (67 loc) · 3.19 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
import java.awt.event.ActionEvent;
import static cs1.Keyboard.*;
import java.awt.BorderLayout;
import javax.swing.ButtonGroup;
import java.util.*;
import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
public class GameFrame extends javax.swing.JFrame implements ActionListener{
private SongList songs;
private Contestant player;
private SetupScreen setup;
private javax.swing.JButton choice1;
private javax.swing.JButton choice2;
private javax.swing.JButton choice3;
private javax.swing.JButton choice4;
public GameFrame(){
/*
setup = new SetupScreen();
setup.run();
//put path as whatever we decide on
songs = new SongList(readString());
player = new Contestant(setupscreen.getContestantName());
*/
super("GameFrame");
choice1 = new JButton("song1");
choice2 = new JButton("song2");
choice3 = new JButton("song3");
choice4 = new JButton("song4");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
choice1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
System.out.println("hi");
}
public static void run1(){
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(GameFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(GameFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(GameFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(GameFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new GameFrame().setVisible(true);
}
});
}
public static void main(String[] args){
run1();
}
}