1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
UIDefaults def = laf.getDefaults();
def.put("ScrollBar:\"ScrollBar.button\"[MouseOver].foregroundPainter",
new Painter<JComponent>() {
public void paint(Graphics2D g2d, JComponent component,
int w, int h) {
g2d.setColor(new Color(245, 245, 245));
g2d.fillRect(0, 0, w, h);
g2d.setColor(Color.GRAY);
g2d.drawRect(0, 0, w, h);
g2d.setColor(Color.BLACK);
Polygon p = new Polygon();
p.addPoint((int) (w / 2 - 3), (int) (h / 2));
p.addPoint((int) (w / 2), (int) (h / 2 + 3));
p.addPoint((int) (w / 2), (int) (h / 2 - 3));
g2d.fillPolygon(p);
}
}); |
Partager