Paints the divider.
Color bgColor = getBackground();
Dimension size = getSize();
// fill
g.setColor(getBackground());
g.fillRect(0, 0, size.width, size.height);
if(getBasicSplitPaneUI().getOrientation() ==
JSplitPane.HORIZONTAL_SPLIT) {
int center = size.width/2;
int x = center - hThumbWidth/2;
int y = hThumbOffset;
// split line
g.setColor(shadowColor);
g.drawLine(center-1, 0, center-1, size.height);
g.setColor(highlightColor);
g.drawLine(center, 0, center, size.height);
// draw thumb
g.setColor((splitPane.hasFocus()) ? focusedColor :
getBackground());
g.fillRect(x+1, y+1, hThumbWidth-2, hThumbHeight-1);
g.setColor(highlightColor);
g.drawLine(x, y, x+hThumbWidth-1, y); // top
g.drawLine(x, y+1, x, y+hThumbHeight-1); // left
g.setColor(shadowColor);
g.drawLine(x+1, y+hThumbHeight-1,
x+hThumbWidth-1, y+hThumbHeight-1); // bottom
g.drawLine(x+hThumbWidth-1, y+1,
x+hThumbWidth-1, y+hThumbHeight-2); // right
} else {
int center = size.height/2;
int x = size.width - vThumbOffset;
int y = size.height/2 - vThumbHeight/2;
// split line
g.setColor(shadowColor);
g.drawLine(0, center-1, size.width, center-1);
g.setColor(highlightColor);
g.drawLine(0, center, size.width, center);
// draw thumb
g.setColor((splitPane.hasFocus()) ? focusedColor :
getBackground());
g.fillRect(x+1, y+1, vThumbWidth-1, vThumbHeight-1);
g.setColor(highlightColor);
g.drawLine(x, y, x+vThumbWidth, y); // top
g.drawLine(x, y+1, x, y+vThumbHeight); // left
g.setColor(shadowColor);
g.drawLine(x+1, y+vThumbHeight,
x+vThumbWidth, y+vThumbHeight); // bottom
g.drawLine(x+vThumbWidth, y+1,
x+vThumbWidth, y+vThumbHeight-1); // right
}
super.paint(g);