Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
JDK 7u4: java.awt.IllegalComponentStateException: The dialog is decorated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JDK 7u4: java.awt.IllegalComponentStateException: The dialog is decorated



I'm trying to upgrade to JDK 7u4 and I've found a first problem with Quaqua 8.0:

[INFO] java.awt.IllegalComponentStateException: The dialog is decorated
[INFO] 	at java.awt.Dialog.setOpacity(Dialog.java:1319)
[INFO] 	at java.awt.Window$1.setOpacity(Window.java:4008)
[INFO] 	at com.sun.awt.AWTUtilities.setWindowOpacity(AWTUtilities.java:174)
[INFO] at sun.lwawt.macosx.CPlatformWindow$3.applyProperty(CPlatformWindow.java:159) [INFO] at sun.lwawt.macosx.CPlatformWindow$3.applyProperty(CPlatformWindow.java:158) [INFO] at com.apple.laf.ClientPropertyApplicator.applyProperty(ClientPropertyApplicator.java:45) [INFO] at com.apple.laf.ClientPropertyApplicator.propertyChange(ClientPropertyApplicator.java:75) [INFO] at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335) [INFO] at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327) [INFO] at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
[INFO] 	at java.awt.Component.firePropertyChange(Component.java:8382)
[INFO] 	at javax.swing.JComponent.putClientProperty(JComponent.java:4093)
[INFO] at ch.randelshofer.quaqua.QuaquaUtilities.setWindowAlpha(QuaquaUtilities.java:726)
[INFO] 	at ch.randelshofer.quaqua.JSheet.addNotify(JSheet.java:306)
[INFO] 	at java.awt.Window.pack(Window.java:807)
[INFO] 	at ch.randelshofer.quaqua.JSheet.showSheet(JSheet.java:1190)
[INFO] 	at ch.randelshofer.quaqua.JSheet.showSaveSheet(JSheet.java:1119)


The relevant code is:

707     /**
708 * Uses some unsupported (dangerous) API calls on the native peers to make 709 * a window translucent. If the API is not found, this method leaves the
 710      * window opaque.
 711      *
 712      * @param w The Window.
 713      * @param value The alpha channel for the window.
 714      */
 715     static void setWindowAlpha(Window w, int value) {
 716         if (w == null) {
 717             return;
 718         }
 719
 720
 721         if (w instanceof RootPaneContainer) {
 722             JRootPane rp = ((RootPaneContainer) w).getRootPane();
 723
 724             // Window alpha is for J2SE 5 on Mac OS X 10.5
725 // See: http://developer.apple.com/technotes/tn2007/tn2196.html#WINDOW_ALPHA 726 rp.putClientProperty("Window.alpha", new Float(value / 255f));
 727
 728         }
 729     }

 302     @Override
 303     public void addNotify() {
 304         super.addNotify();
305 if (UIManager.getBoolean("Sheet.showAsSheet") && !isExperimentalSheet()) {
 306             QuaquaUtilities.setWindowAlpha(this, 240);
 307         }
 308     }


It seems that it tries to set a client property defined since Java 5, that was working with Java 6 and it's no more available (for decorated windows?) in JDK 7u4. Or is it called too late (during addNotify())?

* Caveats: We are using an unsupported API call to make the JSheet translucent. * This API may go away in future versions of the Macintosh Runtime for Java.
 * In such a case, we (hopefully) just end up with a non-opaque sheet.

I've filed it as http://java.net/jira/browse/QUAQUA-160 . I suppose the best thing is to disable the offending call for JDK 7u4, but I'd like to hear some opinion here.

Thanks.



--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
email@hidden
http://tidalwave.it - http://fabriziogiudici.it
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.