- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.java
More file actions
Latest commit
29 lines (20 loc) · 692 Bytes
/
Copy pathWindow.java
File metadata and controls
29 lines (20 loc) · 692 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
packageSaueSpillet;
importjava.awt.Canvas;
importjava.awt.Dimension;
importjavax.swing.JFrame;
publicclassWindowextendsCanvas {
privatestaticfinallongserialVersionUID = -9132444173025938635L;
publicWindow(intwidth, intheight, Stringtitle, Gamegame) {
JFrameframe = newJFrame(title);
frame.setPreferredSize(newDimension(width, height));
frame.setMaximumSize(newDimension(width, height));
frame.setMinimumSize(newDimension(width, height));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.add(game);
frame.setVisible(true);
frame.requestFocus();
game.start();
}
}