public static void main(final String[] args) { game = new Game(); game.frame.add(game); game.frame.setResizable(false); game.frame.setTitle(Game.title); game.frame.pack(); game.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); game.frame.setLocationRelativeTo(null); game.frame.setVisible(true); game.start(); }
public static void main(String[] args) { Game game = new Game(); game.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE)); game.setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE)); game.setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE)); JFrame frame = new JFrame("Tiles.Tile RPG"); frame.setSize(WIDTH * SCALE, HEIGHT * SCALE); /** Important line to prevent memory leak! */ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setResizable(false); frame.add(game); frame.setVisible(true); game.start(); }