I'm drawing a couple of shapes on a JPanel using the paintComponent()
method. The final touch is to add a transparent white gradient towards the top.
I have this:
and I want to get something like this:
I've tried to use the GradientPaint method, but it doesn't seem to work properly for me at all. When I call g.setPaint(new GradientPaint(...))
, it can't seem to draw over the existing pixels at all.
If anyone would like to see what I'm doing, an SSCCE of the code is available at this Pastebin.