Static @FXML variables in FXML Controller

吃可爱长大的小学妹 提交于 2019-11-29 12:55:45

Anyway I refactored everything and it wasn't as hard as I thought. I spent about half the time refactoring as I did searching for a solution.

I'll leave the question in case any other poor souls have the same problem.

Thank you very much for documenting this issue. Since last night, I try to fix it. Like you I guessed that the injected variables are null and could at finally shape my question to query the web for a solution. I found your entry here.

For this problem I suggest a quick dirty solution, I removed the static keyword from the declaration of original variable name at the same time I declared a static equivalent of it inserting a _ character at the end of the original name. In initialize() I've copied the injected objects into the static counterparts without having to refactor all my static inner classes and methods.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!