【发布时间】:2014-07-01 13:32:23
【问题描述】:
我在 JavaFX 场景构建器中创建了我的 RootLayout。它包含 BorderPane 和它的中心 TabPane 与三个选项卡。在第一个选项卡上,我想要 WebView。我的 RootController 包含:
@FXML
private WebView webview;
@FXML
private WebEngine webengine;
我已经通过 fx:id 与 webview 变量在 RootLayout.fxml 中连接了我的 WebView。 我在 RootLayoutController 中的初始化方法是(RootLayout 控制器在 fxml 文件中定义):
@FXML
private void initialize() {
this.webview = new WebView();
this.webengine = this.webview.getEngine();
this.webengine.load("http://www.oracle.com/us/products/index.html");
}
但是页面没有加载。有什么建议吗?
【问题讨论】: