Kong
Kong

Reputation: 9546

Java 2D Lighting Effect

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?

enter image description here

Upvotes: 3

Views: 1058

Answers (1)

FThompson
FThompson

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

Related Questions