--- old/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java 2013-07-12 17:11:56.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java 2013-07-12 17:11:55.000000000 +0400 @@ -107,10 +107,6 @@ loc = rootComponent.getLocation(); } - //It sure will be LWComponentPeer instance as rootComponent is a Window - PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow(); - long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow); - // If there isn't any drag image make one of default appearance: if (fDragImage == null) this.setDefaultDragImage(component); @@ -137,6 +133,11 @@ } try { + //It sure will be LWComponentPeer instance as rootComponent is a Window + PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow(); + long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow); + if (nativeViewPtr == 0L) throw new InvalidDnDOperationException("Unsupported platform window implementation"); + // Create native dragging source: final long nativeDragSource = createNativeDragSource(component, nativeViewPtr, transferable, triggerEvent, (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,