-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
20 lines (16 loc) · 780 Bytes
/
Main.java
File metadata and controls
20 lines (16 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import javax.swing.*;
public class Main extends JFrame {
Main() { // Constructor
this.setResizable(false); // Prevents window from being resized
this.add(new MainMenu()); // Adds the App.java class to the JFrame
this.setTitle("Mazerunner"); // Sets the title of the window
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Allows the window to be closed
this.pack(); // Sizes the window so that all its contents are at or above their preferred sizes
this.setVisible(true); // Makes the window visible
this.setLocationRelativeTo(null); // Centers the window
}
public static void main(String[] args) {
System.setProperty("sun.java2d.opengl", "true"); // Enables OpenGL
new Main();
}
}