Color highlight = UIManager.getColor("SplitPane.highlight"); Color shadow = UIManager.getColor("SplitPane.shadow");
    public void paintBorder(Component c, Graphics  g,                            int x, int y, int width, int height)    {      Color oldColor, dcol;      int x2, y2;      JSplitPane sp;      sp = getSplitPane(c);      if (sp == null)        return;      x2 = x + width - 1;      y2 = y + height - 1;      oldColor = g.getColor();      dcol = c.getBackground();      try      {        switch (sp.getOrientation())        {        case JSplitPane.HORIZONTAL_SPLIT:          g.setColor(dcol);          g.drawLine(x + 1, y, x2 - 1, y);          g.drawLine(x + 1, y2, x2 - 1, y2);          g.setColor(sp.getLeftComponent() != null ? highlight : dcol);          g.drawLine(x, y, x, y2);          g.setColor(sp.getRightComponent() != null ? shadow : dcol);          g.drawLine(x2, y, x2, y2);          break;        case JSplitPane.VERTICAL_SPLIT:          g.setColor(dcol);          g.drawLine(x, y + 1, x, y2 - 1);          g.drawLine(x2, y + 1, x2, y2 - 1);          g.setColor(sp.getTopComponent() != null ? highlight : dcol);          g.drawLine(x, y, x2, y);          g.setColor(sp.getBottomComponent() != null ? shadow : dcol);          g.drawLine(x, y2, x2, y2);          break;        }      }      finally      {        g.setColor(oldColor);      }    }