Beispiel #1
0
  public void showNotify() {
    super.showNotify();

    timer = new Timer();
    TimerTask ui =
        new TimerTask() {
          public void run() {
            render();
            flushGraphics();
          }
        };
    timer.schedule(ui, 0, UI_PERIOD);

    TimerTask logic =
        new TimerTask() {
          public void run() {
            logic();
          }
        };
    timer.schedule(logic, 0, LOGIC_PERIOD);
  }
Beispiel #2
0
 public void hideNotify() {
   super.hideNotify();
   timer.cancel();
 }