changeset 2378:3de717f6ddab

6786238: api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame Fails with NPE since 6u12 b02 Reviewed-by: rupashka
author alexp
date Tue, 25 May 2010 20:22:44 +0400
parents a0c6dae0f173
children 1297a41dbb47
files src/share/classes/javax/swing/DefaultDesktopManager.java
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/DefaultDesktopManager.java	Fri May 21 17:49:15 2010 -0700
+++ b/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