I'm trying to use a transparent PNG as the icon for my Java application. The image on the JFrame and task bar work great. However, when I use the image with a TrayIcon, I get a black matte background around the edge of the PNG.
Has anybody else come across this issue? I would really like to use a PNG instead of GIF or JPEG.
VonC
With Java6, a PNG picture should be used for TrayIcon
, but as mentioned in this SO question, check:
- the background color chosen to represent the transparent pixels
- the transparency options
- the resolution of the icon
- alternate format like SVG (provided you are using external library like Batik, and conversion mechnism to
java.awt.Image
)
来源:https://stackoverflow.com/questions/387768/png-trayicon-transparency-on-windows