JavaFX IllegalAccessException during FXML load()

℡╲_俬逩灬. 提交于 2019-12-03 10:49:55
scottb

Yet another embarrassingly simple problem.

I'm surprised someone didn't jump on this by now.

The problem was in my class DCServRecEditor. Note that the class was declared with default access permission.

JavaFX requires that controller classes be made public.

To be fair to myself, Java's error reporting in this situation is abominable and misleading. The stack trace clearly shows that Java is complaining about being unable to access a member of my class, hence my focus on my instance fields and methods. Java really should have complained that it was the class itself that it could not access and not its members.

I prefer to declare every method and filed public.

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