简体   繁体   English

JavaFX SceneBuilder控制器

[英]JavaFX SceneBuilder Controller

I'm following the tutorial for creating a new JavaFX application with SceneBuilder and I'm trying to add a controller class to the .fxml file. 我正在学习使用SceneBuilder创建新的JavaFX应用程序的教程,并且试图将控制器类添加到.fxml文件中。

https://docs.oracle.com/javafx/scenebuilder/1/get_started/bind-ui-to-logic.htm https://docs.oracle.com/javafx/scenebuilder/1/get_started/bind-ui-to-logic.htm

However, in the "code" section as described in the tutorial, the controller class text field doesn't exist! 但是,在本教程中描述的“代码”部分中,控制器类文本字段不存在!

I am using Eclipse with Gluon's version of Scene Builder v 8.1.1. 我正在将Eclipse与Gluon的Scene Builder v 8.1.1版本一起使用。

Where can I connect my .fxml file to my controller Java class? 我在哪里可以将.fxml文件连接到控制器Java类?

JavaFX scene builder 2: controller class JavaFX场景构建器2:控制器类

Turns out, they moved the controller class field. 原来,他们移动了控制器类字段。 Oracle's documentation is wayy outdated. Oracle的文档过时了。 Thanks to @MhmdAljobairi who pointed out that it's actually on the left side of the window, tucked away in the expandable lists. 感谢@MhmdAljobairi指出,它实际上位于窗口的左侧,隐藏在可扩展列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM