From 9aca53da76962fa7298e84ba72bffac1d6694032 Mon Sep 17 00:00:00 2001 From: Alexander Potochkin Date: Tue, 25 May 2010 20:22:44 +0400 Subject: [PATCH] 6786238: api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame Fails with NPE since 6u12 b02 Reviewed-by: rupashka --- .../javax/swing/DefaultDesktopManager.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java index 5802f6ffe66..1456bab9a34 100644 --- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java @@ -26,17 +26,13 @@ package javax.swing; -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 com.sun.awt.AWTUtilities; import sun.awt.AWTAccessor; import sun.awt.SunToolkit; +import java.awt.*; +import java.beans.PropertyVetoException; + /** This is an implementation of the DesktopManager. * It currently implements the basic behaviors for managing * JInternalFrames in an arbitrary parent. @@ -318,7 +314,10 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab 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