You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
783 B
33 lines
783 B
package Minesweeper;
|
|
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JPanel;
|
|
|
|
public class MinesweeperGame extends JPanel {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
public static final int WIDTH = 600, HEIGTH = 600;
|
|
public Playfield playfield;
|
|
public TimerLable tl;
|
|
|
|
public MinesweeperGame(int _playfieldSize, int _bombAmount) {
|
|
this.setSize(WIDTH, HEIGTH);
|
|
setLayout(null);
|
|
playfield = new Playfield(this, _playfieldSize, _bombAmount);
|
|
|
|
tl = new TimerLable();
|
|
tl.setBounds((WIDTH / 2 - 5), HEIGTH / 2 - 240, 20, 20);
|
|
add(tl);
|
|
tl.start();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
JFrame f = new JFrame();
|
|
MinesweeperGame MsG = new MinesweeperGame(8, 10);
|
|
|
|
f.add(MsG);
|
|
f.setSize(WIDTH, HEIGTH);
|
|
f.setLayout(null);
|
|
f.setVisible(true);
|
|
}
|
|
}
|