package jeux2; public class Chrono implements Runnable{ private static final int PAUSE = 3; private volatile boolean run = true ; private volatile boolean pause = false ; @Override public void run() { while(run){ if ( !pause ) { Main.fond.repaint(); System.out.println("en cours"); } try { Thread.sleep(PAUSE); } catch (InterruptedException e) { } } } public void setPause(boolean pause){ this.pause = pause; } public void stop(){ this.run = false; } public boolean isPause(){ return this.pause; } }