@SuppressWarnings("deprecation") public CPlatformWindow convertJComponentToTarget(final JRootPane p) { Component root = SwingUtilities.getRoot(p); final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); if (root == null || acc.getPeer(root) == null) return null; return (CPlatformWindow) ((LWWindowPeer) acc.getPeer(root)).getPlatformWindow(); }