int midAB = r.width / 2 + r.x; int midAD = r.height / 2 + r.y;
  public void paint(Graphics g, JComponent c)  {    Rectangle r = new Rectangle();    SwingUtilities.calculateInnerArea(c, r);    Color saved = g.getColor();        int midAB = r.width / 2 + r.x;    int midAD = r.height / 2 + r.y;      JSeparator s;    if (c instanceof JSeparator)      s = (JSeparator) c;    else      return;          if (s.getOrientation() == JSeparator.HORIZONTAL)    {          g.setColor(highlight);      g.drawLine(r.x, midAD, r.x + r.width, midAD);            g.setColor(shadow);      g.drawLine(r.x, midAD + 1, r.x + r.width, midAD + 1);    }    else    {      g.setColor(highlight);      g.drawLine(midAB, r.y, midAB, r.y + r.height);            g.setColor(shadow);      g.drawLine(midAB + 1, r.y, midAB + 1, r.y + r.height);    }  }