-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
37 lines (31 loc) · 872 Bytes
/
Copy pathMain.java
File metadata and controls
37 lines (31 loc) · 872 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.Container;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.UIManager;
import Engine.Window;
public class Main
{
public static JFrame w;
public static void main(String[] args)
{
w = new JFrame("Physics Simulator");
w.setSize(500, 500);
Container c = w.getContentPane();
Window screen = new Window(w);
c.add(screen);
c.setPreferredSize(new Dimension(500,500));
w.pack();
w.addKeyListener(screen);
w.addMouseListener(screen);
w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// w.setResizable(false);
w.setVisible(true);
w.setLocationRelativeTo(null);
w.setFocusable(true);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
}