@Override protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) { super.paintLayer(g2, l); if (isLocked()) { busyPainter.paint(g2, l, l.getWidth(), l.getHeight()); } }
// Change the frame for the busyPainter // and mark BusyPainterUI as dirty public void actionPerformed(ActionEvent e) { frameNumber = (frameNumber + 1) % 8; busyPainter.setFrame(frameNumber); // this will repaint the layer setDirty(true); }