예제 #1
0
 public void run() {
   try {
     Thread.sleep(1500);
     Game.setClosing(false);
     System.out.println("time up");
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
 }
예제 #2
0
파일: Game.java 프로젝트: redomar/JavaGame
  /**
   * @author Redomar
   * @version Alpha 1.8.3
   */
  public Game() {
    context = InputContext.getInstance();
    setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
    setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
    setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));

    setFrame(new JFrame(NAME));
    getFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getFrame().setLayout(new BorderLayout());
    getFrame().add(this, BorderLayout.CENTER);
    getFrame().pack();
    getFrame().setResizable(false);
    getFrame().setLocationRelativeTo(null);
    getFrame().setVisible(true);

    requestFocus();
    setDevMode(false);
    setClosing(false);
  }