How to locate a WebView in a JFXPanel in a JTabbedPane?

Viewed 516

I am working about specific web page, and I want to relate together javafx.embed.swing.JFXPanel with its features and swing GUI. I want to locate jfxPanel to JTabbedPane? Here are two methods for JFXPanel.

private JFXPanel getSearchPanel() {
    jfxPanel = new JFXPanel();
    createScene();
    setLayout(new BorderLayout());
    jfxPanel.setVisible(true);
    return jfxPanel;
}

private void createScene() {
    PlatformImpl.startup(new Runnable() {
        @Override
        public void run() {
            Pane root = new WebViewPane();
            Scene scene = new Scene(root, 80, 50);
            jfxPanel.setScene(scene);
        }
    });
}

and method where I create JTabbedPane for the browser:

private void createNewTab() {
        JPanel panel = new JPanel(new BorderLayout());
        startPage = startPageField.getText();
        panel.add(new JScrollPane(getSearchPanel()), BorderLayout.CENTER);
        tabPane.setBackground(Color.PINK);
        tabPane.addTab(startPage, panel);   
    }

Thank you for any help or contribution!

1 Answers
Related