-
Bug
-
Resolution: Duplicate
-
P3
-
8
-
Java build128
Windows 8.1
Intel i5-760
4GB RAM
both Eclipse 4.3 and eFXclipse
I have found this regression in the recent preview builds of Java8. Using build106 there is no problem but using b116 and b128, the bug can be reproduced.
The bug is related to using the load() method of FXMLLoader object. In certain conditions, the attributes annotated by @FXML are not injected and causing nullPointerException upon access.
I have found three conditions to reproduce the bug,
1- Using <fx:root> in the fxml
2- having the controller in a different package than the instantiating class
3- using an extension of the controller for instantiation
I think you will need to have a look at the attached simple example to get the idea, but suffice to say without all three conditions, I was not able to reproduce this bug.
I didn't have a problem with Javafx2 and build 106 of java8, but when I tried b116, I noticed there was something wrong but I wasn't sure what. When I noticed the issue is still in b128, I decided to investigate it a bit more and report it. When I switch back to b106, the problem is not there and the annotated attributes are properly injected.
Thanks all
Run the sample by executing MyMain
The bug is related to using the load() method of FXMLLoader object. In certain conditions, the attributes annotated by @FXML are not injected and causing nullPointerException upon access.
I have found three conditions to reproduce the bug,
1- Using <fx:root> in the fxml
2- having the controller in a different package than the instantiating class
3- using an extension of the controller for instantiation
I think you will need to have a look at the attached simple example to get the idea, but suffice to say without all three conditions, I was not able to reproduce this bug.
I didn't have a problem with Javafx2 and build 106 of java8, but when I tried b116, I noticed there was something wrong but I wasn't sure what. When I noticed the issue is still in b128, I decided to investigate it a bit more and report it. When I switch back to b106, the problem is not there and the annotated attributes are properly injected.
Thanks all
Run the sample by executing MyMain
- duplicates
-
JDK-8092606 A controller with private fields gets broken when it's subclass is used as a fxml controller
- Resolved
- relates to
-
JDK-8095621 SceneBuilder doesn't start since FX 8 u20 b04
- Closed