提交 d3c98585 编写于 作者: A alexp

6786238: api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame...

6786238: api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame Fails with NPE since 6u12 b02
Reviewed-by: rupashka
上级 8a08048e
...@@ -26,17 +26,13 @@ ...@@ -26,17 +26,13 @@
package javax.swing; package javax.swing;
import java.awt.*; import com.sun.awt.AWTUtilities;
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.AWTAccessor;
import sun.awt.SunToolkit; import sun.awt.SunToolkit;
import java.awt.*;
import java.beans.PropertyVetoException;
/** This is an implementation of the <code>DesktopManager</code>. /** This is an implementation of the <code>DesktopManager</code>.
* It currently implements the basic behaviors for managing * It currently implements the basic behaviors for managing
* <code>JInternalFrame</code>s in an arbitrary parent. * <code>JInternalFrame</code>s in an arbitrary parent.
...@@ -318,7 +314,10 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab ...@@ -318,7 +314,10 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
dragMode = DEFAULT_DRAG_MODE; dragMode = DEFAULT_DRAG_MODE;
if (p != null) { if (p != null) {
String mode = (String)p.getClientProperty("JDesktopPane.dragMode"); 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; dragMode = OUTLINE_DRAG_MODE;
} else if (mode != null && mode.equals("faster") } else if (mode != null && mode.equals("faster")
&& f instanceof JInternalFrame && f instanceof JInternalFrame
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册