本文介绍了将数据传递给控制器JAVAFX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图从一个传递数据(变量)阶段到另一个阶段,但当我尝试在第二阶段访问它们时,它们是空的。主窗口的代码。转到window1
my imageI'm trying to pass the data (variables) from one stage to another stage, but when I try to access them in the second stage they are null. Code of the mainWindow. Go to window1
c>初始化()时,不会为空。Then remove the fx:controller attribute from your FXML file. This way the initStage() method is called before the load() method, and tituloAnterior will not be null when initialize() is called.
这篇关于将数据传递给控制器JAVAFX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!