void () { if (myBusy) { if (myBusyIcon == null) { myBusyIcon = new AsyncProcessIcon(toString()); myBusyIcon.setOpaque(false); myBusyIcon.setPaintPassiveIcon(false); add(myBusyIcon); } } //noinspection DuplicatedCode if (myBusyIcon != null) { if (myBusy) { myBusyIcon.resume(); } else { myBusyIcon.suspend(); SwingUtilities.invokeLater(() -> { if (myBusyIcon != null) { repaint(); } }); } if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } } }