PaintComponent « JLabel « Java Swing Q&A





1. Destroy a JLabel from within its paintComponent    java-forums.org

You as the programmer do not have absolute control over when a component's paintComponent method is called since it can be called at your suggestion (via repaint() for instance) or at the discretion of the JVM for instance if the operating system tells it to repaint "dirty regions" on your GUI. Not only that, you can't even say for certain that ...