Jump to content

Transparent Png As Window Icon

Recommended Posts

Does anybody happen to know why transparent icons do not appear transparent at all, in the titel bar of a Java1.6 Window that is using the default Java Look and Feel?My application uses the java L&F for all its windows and dialogs, and thus has no windows look nor feel at all. Which is intended for no important reason. The icon that is displayed in the top left corner of the window and in the taskbar when minimized, are set by JFrame.setIconImages(). I have used two png files both with transparency for this method: one 16x16 and one 32x32. The 32x32 is working perfectly fine in the application itself and when the OS shows it on ALT+TAB, but the 16x16 image has no transparency anywhere used. Or so it appears.When magnifying a screenshot, it is clearly seen that the whitish edges around the icon are actually in the color of the inactive-titlebar. See these screenshots (and do a colortest if you don't believe):WindowIcon.pngWindowIcon2.pngFor days now I have been searching on the net what is causing these edges, or why the inactive color is used as the background at anytime. There has been a bug in java 1.5 concerning window icons, and it should have been fixed according to the bugfixes at Sun (no reference here), but still it is not working properly.Anybody knows anything about this?

Edited by Jack McKalling
Link to post
Share on other sites
  • 1 year later...

One year later, I still haven't figured it out.. Though I now understand the actual background of the window icon is really the inactive window color itself, as if the active color is always rendered over the inactive color, but they forgot to do that for the space of the window icon.Probably no one has solved this issue yet, have you? :)

Link to post
Share on other sites

This is not what I mean. I manage the image myself, I can make the background transparent at will, but it is Java that does not display the correct background underneath my image, that causes my unhappiness... :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...