@Override public void paint(Graphics g) { super.paint(g); if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } }
private void updateBusy() { if (myBusy) { if (myBusyIcon == null) { myBusyIcon = new AsyncProcessIcon(toString()).setUseMask(false); myBusyIcon.setOpaque(false); myBusyIcon.setPaintPassiveIcon(false); add(myBusyIcon); } } if (myBusyIcon != null) { if (myBusy) { myBusyIcon.resume(); } else { myBusyIcon.suspend(); //noinspection SSBasedInspection SwingUtilities.invokeLater( new Runnable() { public void run() { if (myBusyIcon != null) { repaint(); } } }); } if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } } }
@Override public void doLayout() { super.doLayout(); if (myBusyIcon != null) { myBusyIcon.updateLocation(this); } }