private Container createWindow() {
        Component root = SwingUtilities.getRoot(this);
        final JDialog win = new JDialog((Window) root);
        win.setUndecorated(true);
        ComponentListener cl = new ComponentAdapter() {

            @Override
            public void componentMoved(ComponentEvent e) {
                if (isSelected()) {
                    adjustWindow(win);
                }
            }
        };
        root.addComponentListener(cl);
        win.getContentPane().add(windowPanel);
        win.setFocusable(true);
        win.pack();
        return win;
    }