if (c.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null)
AbstractButton b = (AbstractButton) c; ButtonModel m = b.getModel(); if (b.getBackground() instanceof UIResource && b.isContentAreaFilled() && b.isEnabled() && ! m.isArmed() && ! m.isPressed() && UIManager.get(getPropertyPrefix() + "gradient") != null)
  public void update(Graphics g, JComponent c)  {    if (c.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null)      {        MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(),                                 SwingConstants.VERTICAL,                                 getPropertyPrefix() + "gradient");        paint(g, c);      }    else      super.update(g, c);  }