To handle pop-up windows in your Swing application you have two options:


1. Register default Swing pop-up handler implementation: 

browser.setPopupHandler(new com.teamdev.jxbrowser.chromium.swing.DefaultPopupHandler());

2. Register your own implementation where you decide how exactly you would like to display a new pop-up window (e.g. in JFrame, JWindow, application tab):  

browser.setPopupHandler(new PopupHandler() {
    public PopupContainer handlePopup(PopupParams params) {
        return new PopupContainer() {
            public void insertBrowser(final Browser browser, final Rectangle initialBounds) {
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        BrowserView browserView = new BrowserView(browser);
                        browserView.setPreferredSize(initialBounds.getSize());

                        final JFrame frame = new JFrame("Popup");
                        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                        frame.add(browserView, BorderLayout.CENTER);
                        frame.pack();
                        frame.setLocation(initialBounds.getLocation());
                        frame.setVisible(true);
                        frame.addWindowListener(new WindowAdapter() {
                            @Override
                            public void windowClosing(WindowEvent e) {
                                browser.dispose();
                            }
                        });

                        browser.addDisposeListener(new DisposeListener<Browser>() {
                            public void onDisposed(DisposeEvent<Browser> event) {
                                frame.setVisible(false);
                            }
                        });
                    }
                });
            }
        };
    }
});