boolean mouseIsOver = false; if (c instanceof AbstractButton) { ButtonModel bmodel = ((AbstractButton) c).getModel(); mouseIsOver = bmodel.isRollover(); } if (mouseIsOver)
    public void paintBorder(Component c, Graphics g, int x, int y, int w,             int h)    {      boolean mouseIsOver = false;      if (c instanceof AbstractButton)        {          ButtonModel bmodel = ((AbstractButton) c).getModel();          mouseIsOver = bmodel.isRollover();        }      if (mouseIsOver)        super.paintBorder(c, g, x, y, w, h);    }