Tuesday, October 21, 2014

JavaFX TextField always returns empty String.

Today I worked on JavaFX fxml application and found unusual bug. This application has multiple tabs with many TextFields in each tab. While testing, one of the TextFields always returned empty String when using getText() method. It was very very confusing for me at the moment, but eventually I found out what was the problem. I accidentally gave the same ID to two TextFields in the different tabs. Debugging this was a challenge because I assumed that Scene Builder 2 would informed me if something like this happened.
So if someone encounters similar problem, check your IDs first.

1 comment:

  1. THANK YOU. This has been an issue with my program for DAYS.

    ReplyDelete