In my JFrame
pane I wanna dislay a webview
, the decare of class is :
public class MainTabbedForm extends javax.swing.JFrame {
I have added a Button
named Display Web
and here is the code of this :
private void siteSurveyActionPerformed(java.awt.event.ActionEvent evt) {
JFrame myFrame = new JFrame();
JFXPanel myFXPanel = new JFXPanel();
myFrame.add(myFXPanel);
Platform.runLater(() -> {
BorderPane borderPane = new BorderPane();
WebView webComponent = new WebView();
webComponent.getEngine().load("http://google.com/");
borderPane.setCenter(webComponent);
Scene scene = new Scene(borderPane,450,450);
myFXPanel.setScene(scene);
});
}
But when I run the program and press the Display Web
Button it does nothing!
And nothing in Netbeans
output displaye, No error or anything.
Where I am doing wrong?