-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartGame.java
More file actions
37 lines (26 loc) · 910 Bytes
/
StartGame.java
File metadata and controls
37 lines (26 loc) · 910 Bytes
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
import java.awt.HeadlessException;
import java.io.IOException;
import javax.swing.JFrame;
public class StartGame extends JFrame {
public StartGame(String title) throws HeadlessException, IOException {
super(title);
this.setSize(1000, 800);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
this.setFocusable(false);
Game game = new Game();
game.requestFocus();
game.addKeyListener(game);
game.setFocusable(true);
game.setFocusTraversalKeysEnabled(false);
this.add(game);
}
public static void main(String[] args) throws IOException {
// To skip the login screen, open the 2 codes below and comment out the 2 codes
// at the very bottom.
// StartGame screen = new StartGame("Space Game");
// screen.setVisible(true);
LoginScreen loginScreen = new LoginScreen();
loginScreen.setVisible(true);
}
}