0

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.

UnguruBulan
  • 890
  • 4
  • 12
  • 24
  • no one with an ideea? – UnguruBulan May 11 '15 at 19:15
  • An question sometimes needs days to be answered, as nobody ever knows everything here. Did you check the bounds of the Browser? Can't you add it in the FXML directly by importing it in the head of the file and then add the tag where it belongs? Does it work if you show the browser instead the Stage? – michaeln May 12 '15 at 14:25

0 Answers0