Reputation: 9546
I'm trying to replicate the lighting effect shown on each of the bars in the image below in Java 2D. I really don't even know where to start as I have no Java 2D experience.
Can anyone offer me some pointers?
Upvotes: 3
Views: 1058
Reputation: 28687
Those are basic gradients applied to rectangles and other polygons.
You can use GradientPaint
to create a gradient effect.
g.setPaint(yourGradientPaint);
g.draw(yourShape);
Upvotes: 5