Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In java, is there any simple way to add 'glow' to text on a swing component?

What would be the easiest way to make plain text on a swing component have a glowing effect in the background?

Example: From http://i.imgur.com/3jtUm.png -> http://i.imgur.com/hXTOf.png

The difference may not be that noticeable but there's definitely a glow in the second image. Thanks in advance. And by the way I couldn't find any answers for this question in java.

like image 761
injectv Avatar asked Dec 06 '25 14:12

injectv


1 Answers

The easiest way is probably to draw the text on top of a blurred version of itself. The blurred version will provide the "glow" around the edges.

You will probably need to experiment with the right amount of blur and level of transparency when drawing the blurred version to get the right effect.

For blurring techniques see: How do I blur an image?

like image 177
mikera Avatar answered Dec 08 '25 19:12

mikera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!