I have a JavaFX interface generated by SceneBuilder...so I have my view components in sample.fxml. When I start the application it looks like this : https://i.stack.imgur.com/tauIg.png In that blue pane I want to add the browser ( with JxBrowser library), so I did this:
public void loadMap(ActionEvent actionEvent) {
initComponents(); //setting my buttons visibility
Browser browser = new Browser();
BrowserView browserView = new BrowserView(browser);
gamePane.getChildren().add(browserView);
browser.loadURL("http://www.google.com");
gamePane.getChildren().add(new Button("random"));
}
This is my main:
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Google Maps ");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
That button was added, but my browser won't appear..What can I do?I used this in Swing and it worked,but here seems not. The browser is loaded(because I get the specific messages in console) but isn't displayed.