@Override protected void paintLayer(Graphics2D g2, JXLayer<JComponent> l) { super.paintLayer(g2, l); if (isLocked()) { busyPainter.paint(g2, l, l.getWidth(), l.getHeight()); } }
public LockableDemo() { super("Lockable layer demo"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JComponent view = createLayerPanel(); layer = new JXLayer<JComponent>(view); layer.setUI(blurUI); add(layer); add(createToolPanel(), BorderLayout.EAST); setJMenuBar(createMenuBar()); setSize(380, 300); setLocationRelativeTo(null); }