EVALUATION
This problem happens when a toolkit image is used as a frame icon.
Toolkit images need to be prepared before usage, because they are
loaded and processed asynchronously. Utility class MediaTracker
can be used to prepare an image.
If image can not be loaded for any reasons, null CImage is returned.
|
EVALUATION
This is a regression. See next log of javatest run (jar would be attached).
You will see that same jar being run on jdk1.6.0 runs correctly and produce exception being run with jdk1.7
$ /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
$ /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java -jar javatest.jar
$ java -version
openjdk version "1.7.0-ea"
OpenJDK Runtime Environment (build 1.7.0-ea-b223)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
$ java -jar javatest.jar
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:357)
at sun.lwawt.macosx.CImage$Creator.createFromImage(CImage.java:101)
at sun.lwawt.macosx.CPlatformWindow.getImageForTarget(CPlatformWindow.java:734)
at sun.lwawt.macosx.CPlatformWindow.updateIconImages(CPlatformWindow.java:541)
at sun.lwawt.macosx.CPlatformWindow.setVisible(CPlatformWindow.java:506)
at sun.lwawt.LWWindowPeer$1.run(LWWindowPeer.java:273)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:240)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:134)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
|
EVALUATION
Author: Mike Swingler Date: 24/Aug/11 06:31 PM
Frame icon images currently replace the picture of the window when it is minimized into the Dock. We do not set an icon in the titlebar, since those are reserved for actual filesystem representations, and doing otherwise is a violation of the human interface guidelines.
Author: Frank Kline Date: 24/Aug/11 06:38 PM
Thanks for clarifying the expected functionaliy!
Author: Yuri Nesterenko Date: 11/Oct/11 11:32 AM
Build: b211
closed/java/awt/Icon/SetIconImageExceptionTest/SetIconImageExceptionTest
Author: Taras Ledkov Date: 17/Oct/11 03:05 PM
Build: b213
java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative
Keywords: test-fail-macos
Author: Bino George Date: 08/Nov/11 06:42 PM
I tested this on both 10.7.2 and 10.6.8 and I am not seeing any exceptions when calling setIconImages.
Please reopen with a testcase if you can still reproduce it.
Author: Frank Kline Date: 09/Nov/11 05:07 AM
Hi Bino,
Looking into this a bit more, it seems like this might have been a symptom of an underlying problem.
It works fine if I load the images with:
<div class="panel" style="border-width: 1px;"><div class="panelContent">InputStream resourceAsStream = ...
return ImageIO.read(resourceAsStream);
Author: Taras Ledkov Date: 09/Nov/11 02:30 PM
Reproduced on b216, test:
java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative
But this test case differs from original description. In this case image is used in DnD as the source's dragImage. Exception is similar
Author: Bino George Date: 10/Nov/11 06:34 PM
Looks like this test fails on JDK6 as well, so this is not a regression from JDK6
|