6786238: api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame Fails with NPE since 6u12 b02
Reviewed-by: rupashka
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java Fri May 21 17:49:15 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java Tue May 25 20:22:44 2010 +0400
@@ -26,16 +26,12 @@
package javax.swing;
+import com.sun.awt.AWTUtilities;
+import sun.awt.AWTAccessor;
+import sun.awt.SunToolkit;
+
import java.awt.*;
import java.beans.PropertyVetoException;
-import java.beans.PropertyChangeEvent;
-import javax.swing.border.Border;
-import java.awt.event.ComponentListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-
-import sun.awt.AWTAccessor;
-import sun.awt.SunToolkit;
/** This is an implementation of the <code>DesktopManager</code>.
* It currently implements the basic behaviors for managing
@@ -318,7 +314,10 @@
dragMode = DEFAULT_DRAG_MODE;
if (p != null) {
String mode = (String)p.getClientProperty("JDesktopPane.dragMode");
- if (mode != null && mode.equals("outline")) {
+ Window window = SwingUtilities.getWindowAncestor(f);
+ if (window != null && !AWTUtilities.isWindowOpaque(window)) {
+ dragMode = DEFAULT_DRAG_MODE;
+ } else if (mode != null && mode.equals("outline")) {
dragMode = OUTLINE_DRAG_MODE;
} else if (mode != null && mode.equals("faster")
&& f instanceof JInternalFrame