United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6339074 : Improve icon support

Details
Type:
Enhancement
Submit Date:
2005-10-19
Status:
Resolved
Updated Date:
2006-08-07
Project Name:
JDK
Resolved Date:
2006-05-12
Component:
client-libs
OS:
solaris_2.5,windows_nt,solaris_2.5.1,linux_redhat_7.2,linux,windows_xp,windows_2000
Sub-Component:
java.awt
CPU:
x86,sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.0,unknown,1.1.8,1.4.0_04,1.4.2,5.0,6
Fixed Versions:

Related Reports
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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



Hardware and Software, Engineered to Work Together