How to use FXMLLoader.load() - JavaFX 2

前端 未结 2 1513
不思量自难忘°
不思量自难忘° 2020-12-17 20:04

I am building a JavaFX application using the JavaFX Scene Builder. The interface was created in the Scene Builder and a FXML file (main.fxml) was created.

To use the

2条回答
  •  鱼传尺愫
    2020-12-17 20:39

    Due to a variety of entities eligible to be loaded through FXML you need to state the expected type yourself.

    Parent page = FXMLLoader.load(MainWindowController.class.getResource("main.fxml").toExternalForm());
    

提交回复
热议问题