I have something I can\'t understand: my Swing GUI contains a \'play\' and \'pause\' button. I have also a static variable that defines \'ON\' and \'OFF\' states. (The main
@Override public void actionPerformed(ActionEvent e) { new Thread() { public void run() { //your code which runs on click event } }.start(); }