views:

565

answers:

2

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.

A: 

convert it to gif, then see this: http://jeans.studentenweb.org/java/trayicon/trayicon.html

Andrew Theken
The page is not available (any more).
mklhmnn
+1  A: 

With Java6, a PNG picture should be used for TrayIcon, but as mentioned in this SO question, check:

VonC
The `TrayIcon` constructor takes an image. Are you sure that Java can create an image from an SVG file?
mklhmnn
@mklhmnn You are right, but with a Java library like Batik , you can create an Image from a SVG file. See also thread http://markmail.org/message/pfcceqjgy2mxvy6m
VonC
Sure, but are you sure this will solve the problem?
mklhmnn
@mklhmnn: not tested. And the OP didn't return to give us any feedback. Do you have any new element to add to this issue?
VonC