How to create a custom Java Swing GUI Component with a shape and gradient?

I think you're going to need to use an image mask (examples here and here ) if you are to replicate that cloud exactly.

I think you're going to need to use an image mask (examples here and here) if you are to replicate that cloud exactly. The process will require 2 images: The cloud outline (the blue parts) An image mask is the shape of the cloud, probably black outside and white inside Then your drawing process, which you'll have to do each time the % storage changes will be: Create a new buffered image Draw then green fill bar in the style you want (e.g. Slanted as in this image) Copy the image mask over this Draw this new image to the screen, with the mask applied as described here Draw the cloud outline image to screen That's going to take an hour or so for you to put together, so I'm not going to do it for you. Have a go, and if you run in to problems (or don't understand anything I just described) then ask about that specifically.

You can use GlyphVector#getGlyphOutline() to get the shape of a Unicode character like ☝ \u2601 and fill it with a GradientPaint.

You can do that with a JLabel and a custom-implemented class derived from Icon.

Can you please, post here a code snippet, or some elaboration of your answer, Thanks – Asghar Jul 25 at 13:30 I imagine you are familiar with how to display an Icon in a JLabel. Subclassing an icon, giving it a percentage attribute and drawing it yourself shouldn't be too hard, I guess. – Joey Jul 25 at 13:53.

Java gradient label example And if you understand (or can translate from) portuguese, there's also this discussion with a solution at the end.

Thanks, let me try this one. – Asghar Jul 25 at 13:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions