JComponent (DropTargetDragEvent event) { if (event == null) return null; // no appropriate event Object source = event.getDropTargetContext().getComponent(); JComponent component = source instanceof JComponent ? (JComponent)source : null; if (component == null) return null; // heavyweight components are not supported if (component instanceof Autoscroll) return null; // Swing DnD is used if (component.getAutoscrolls()) return null; // default scroller is used if (!component.isShowing()) return null; // the component is not visible on screen return ClientProperty.isTrue(component, ENABLED) ? component : null; }