JDK-6425614 : PIT: New icon is not refreshed properly on the title bar for LAF decorated JFrame - setIconImgs
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-05-14
  • Updated: 2010-04-03
  • Resolved: 2006-08-02
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 Availability Release.

To download the current JDK release, click here.
JDK 6
6 b94Fixed
Related Reports
Relates :  
Relates :  
Description
I have a JFrame with default look and feel decorations turned on. The frame is initially set with duke icon and icon is shown properly when the frame is shown. Now I am changing the icon of the frame on clicking a button. On clicking a button, I am reading a new image, adding it to the list and calling setIconImages(). I expect the newly passed image to be shown on the swing decorated title bar. But the icon is not changed until I resize the frame. 

The same process works fine when I call setIconImage() instead of setIconImages() inside the action listener of the button. 

This is noticed on WinXP and SolSparc10-JDS with b85 AWT PIT build. This is a bug in the new feature (setIconImages) and the existing API setIconImage works fine where the icon is shown immediately without a resize. 

I have attached a sample test. Execute the sample test. You would see a frame with 2 buttons. Click on the setIconImage button. You will notice that the icon on the title bar changes immediately. Click on setIconImages(). You will notice that the icon does not change on the title bar immediately. You will have to resize the frame a bit in order to see the new icon.

Comments
WORK AROUND Calling repaint() after the call to setIconImages() will update the JFrame's icon.
12-06-2006

EVALUATION The bug is caused by fix for 6339074. JFrame overrides setIconImage() to fire an property changed event. This event is not fired if icons are set using setIconImages(), so the icon is not updated. This issue should be fixed together with 6425606.
17-05-2006