code: protected Icon getIcon(AbstractButton b) {
          Icon        icon  = b.getIcon();
          ButtonModel model = b.getModel();
  
          if (!model.isEnabled()) {
              icon = getSynthDisabledIcon(b, icon);
          } else if (model.isPressed() && model.isArmed()) {
              icon = getPressedIcon(b, getSelectedIcon(b, icon));
          } else if (b.isRolloverEnabled() && model.isRollover()) {
              icon = getRolloverIcon(b, getSelectedIcon(b, icon));
          } else if (model.isSelected()) {
              icon = getSelectedIcon(b, icon);
          } else {
              icon = getEnabledIcon(b, icon);
          }
  
          if (icon == null) {
              return getDefaultIcon(b);
          }
  
          return icon;
      }
docs: Returns the Icon to use in painting the button.
  
  @param  b the button.
  
  @return the icon.