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); } } }
protected final void showProgress(String message) { myProgressMessage.setText(message); if (myProgressPanel.getParent() == null) { myGlassLayer.setEnabled(false); myProgressIcon.resume(); myLayeredPane.add(myProgressPanel, LAYER_PROGRESS); myLayeredPane.repaint(); } }