控制器 Controller 如果我想单击某个按钮,触发一个事件,我们需要使用到控制器。 要想使控制器生效,需要在fxml文件中的布局标签上加入这样一段 fx :controller ="com.company.Controller"