On Tue, 25 Sep 2007 08:55:41 -0700, Todd <>
wrote, quoted or indirectly quoted someone who said :
>
>I have created two icons, one with a triangle pointing to the right
>and one with a triangle pointing down. Both of the triangles sit upon
>a white background in the .jpg files.
Ordinary JPGs do not support transparency. You need a png or gif.
You normally insert the transparency with your paint program. You can
also create images programatically with transparency using the alpha
channel.
See
http://mindprod.com/applet/masker.html
for an example.
You could also create such an image by painting on a custom JPanel.
Don't clear the background. Just paint the arrow. You don't need to
fool about with the alpha channel.
One other way to do it is to find suitable Unicode glyph and use it in
a JLabel with a font that supports it.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com