public void paintIcon(Component c,
Graphics g,
int x,
int y) {
Color windowBodyColor = MetalLookAndFeel.getWindowBackground();
Color titleColor = MetalLookAndFeel.getPrimaryControl();
Color edgeColor = MetalLookAndFeel.getPrimaryControlDarkShadow();
g.translate(x, y);
// draw background color for title area
// catch four corners and title area
g.setColor(titleColor);
g.fillRect(0,0, 16,16);
// fill body of window
g.setColor(windowBodyColor);
g.fillRect(2,6, 13,9);
// draw light parts of two "bumps"
g.drawLine(2,2, 2,2);
g.drawLine(5,2, 5,2);
g.drawLine(8,2, 8,2);
g.drawLine(11,2, 11,2);
// draw line around edge of title and icon
g.setColor(edgeColor);
g.drawRect(1,1, 13,13); // entire inner edge
g.drawLine(1,0, 14,0); // top outter edge
g.drawLine(15,1, 15,14); // right outter edge
g.drawLine(1,15, 14,15); // bottom outter edge
g.drawLine(0,1, 0,14); // left outter edge
g.drawLine(2,5, 13,5); // bottom of title bar area
// draw dark part of four "bumps" (same color)
g.drawLine(3,3, 3,3);
g.drawLine(6,3, 6,3);
g.drawLine(9,3, 9,3);
g.drawLine(12,3, 12,3);
g.translate(-x, -y);
}
|