JDK-6339074 : Improve icon support
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version:
    1.0,unknown,1.1.8,1.4.0_04,1.4.2,5.0,6 1.0,unknown,1.1.8,1.4.0_04,1.4.2,5.0,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    linux,linux_redhat_7.2,solaris_2.5,solaris_2.5.1,windows_nt,windows_2000,windows_xp linux,linux_redhat_7.2,solaris_2.5,solaris_2.5.1,windows_nt,windows_2000,windows_xp
  • CPU: x86,sparc
  • Submitted: 2005-10-19
  • Updated: 2017-05-16
  • Resolved: 2006-05-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6 b85Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
When setting the icon for a window there are a couple of limitations:
1) You can't set multiple sizes. So, the same icon is used in the task bar (16x16) and when the user Alt-Tabs (32x32). As a developer, you have to make a choice as to which one of these will be ugly.
2) You can't set transparent icons. Using PNG with an alpha channel results in very ugly icons.

JUSTIFICATION :
In order for Java applications to truly co-exist on a platform, they have to look nice. The current implementation makes them appear unprofessional. As a result, we have to write native code to fix these problems.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
First, icons should support transparency.

Second, perhaps a new image format that can include multiple images of different sizes should be supported.
ACTUAL -
I am forced to create opaque icons. Then, I create a 16x16 for the task bar, but when the user presses Alt-Tab, a 32x32 icon is displayed, which is just scaled up from 16x16. If, instead, I use a 32x32 icon, the task bar icon looks terrible.

---------- BEGIN SOURCE ----------
JFrame frame = new JFrame().
frame.setIconImage(/* pass a transparent PNG */);

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Native code.
Additional problems being fixed:
- Dialog don't always inherit icon from parent frame on XAWT
- Ownerless dialogs always displays an unmodifiable "coffee cup" icon 
(see description of 6317332 for details)

Comments
EVALUATION Need to implement appropriate API
2006-04-03