SUGGESTED FIX
Name: asR10013 Date: 04/08/2002
The problem seems to be caused by the following mistake in the source
code of the BevelBorder class:
protected void paintLoweredBevel(Component c, Graphics g, int x, int y,
int width, int height) {
Color oldColor = g.getColor();
int h = height;
int w = width;
g.translate(x, y);
// the following section =>
g.setColor(getShadowInnerColor(c));
// VSH: these are the topmost and the leftmost lines,
// but they are drawn with the inner color
g.drawLine(0, 0, 0, h-1);
g.drawLine(1, 0, w-1, 0);
g.setColor(getShadowOuterColor(c));
g.drawLine(1, 1, 1, h-2);
g.drawLine(2, 1, w-2, 1);
// <= should look like this =>
/*
g.setColor(getShadowOuterColor(c));
g.drawLine(0, 0, 0, h-1);
g.drawLine(1, 0, w-1, 0);
g.setColor(getShadowInnerColor(c));
g.drawLine(1, 1, 1, h-2);
g.drawLine(2, 1, w-2, 1);
*/
// <=
g.setColor(getHighlightOuterColor(c));
g.drawLine(1, h-1, w-1, h-1);
g.drawLine(w-1, 1, w-1, h-2);
g.setColor(getHighlightInnerColor(c));
g.drawLine(2, h-2, w-2, h-2);
g.drawLine(w-2, 2, w-2, h-3);
g.translate(-x, -y);
g.setColor(oldColor);
}
I have applied these changes to rt.jar of my JDK 1.4.1 installation.
The bug has disappeared.
======================================================================
|