There is an animator object, but it was stopped all the time. I've just created the Animator instance it and nothing more, never actually started it. There is also a listener for window closing which will stop it if it's running like this:
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
new Thread(new Runnable() {
@Override
public void run() {
if (animator.isAnimating()) {
animator.stop();
}
System.exit(0);
}
}).start();
}
});
All repaint were called from action listeners and setter methods manually.
( Why an animator if i call repaints manually? I have a FPS display, and if it's enabled, I start the animator for showing accurate fps value. Maybe it would be a better idea to have an animator always + some boolean needToRepaint flag? )