Rectangle rect;
rect = this.getBounds ();
rect.x = 0;
rect.y = 0;
graphics.setColor ( Color.darkGray );
graphics.drawLine ( rect.x, rect.y, rect.x, rect.y + rect.height - 2 );
graphics.drawLine ( rect.x, rect.y, rect.x + rect.width - 2, rect.y );
graphics.setColor ( Color.white );
graphics.drawLine ( rect.x + rect.width - 1, rect.y + rect.height - 1, rect.x + rect.width - 1, rect.y + 1 );
graphics.drawLine ( rect.x + rect.width - 1, rect.y + rect.height - 1, rect.x + 1, rect.y + rect.height - 1 );
rect.x++;
rect.y++;
rect.width -= 2;
rect.height -= 2;
graphics.setColor ( Color.blue );
rect.width = rect.width * (nCurPos - nMinPos) / (nMaxPos - nMinPos);
graphics.fillRect ( rect.x, rect.y, rect.width, rect.height );