-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMineSweeper.java
39 lines (35 loc) · 1.05 KB
/
MineSweeper.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
/** MineSweeper
* @author Chase Carnaroli
* @period 6
*
* Main code which runs the game
*/
// Import to support default look and feel
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
// main()
public class MineSweeper {
public static void main(String[] args){
// Set look and feel default
try {
// Set cross-platform Java L&F (also called "Metal")
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle exception
}
catch (InstantiationException e) {
// handle exception
}
catch (IllegalAccessException e) {
// handle exception
}
Game mineSweeper = new Game();
UI display = new UI(mineSweeper);
mineSweeper.setDisplay(display);
mineSweeper.playGame();
}
}