Example #1
0
  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);
      }
    }
  }
Example #2
0
 @Override
 public void paint(Graphics g) {
   super.paint(g);
   if (myBusyIcon != null) {
     myBusyIcon.updateLocation(this);
   }
 }
Example #3
0
 @Override
 public void doLayout() {
   super.doLayout();
   if (myBusyIcon != null) {
     myBusyIcon.updateLocation(this);
   }
 }