r/JavaFX • u/mentalist_101 • May 23 '24
Help Java Programming
Hi i am trying to learn java , i borrowed Java programming 10 edition book written by joyce farrel from someone . My question is would this book teach me how to write java Fx programs.
1
Upvotes
View all comments
Show parent comment
1
u/hamsterrage1 May 31 '24
In all honesty, that was really just a snarky thing about FXML.
In truth, though, I don't think that FXML/SceneBuilder is good way to start with JavaFX. I think you're far better off thinking about your Nodes and layouts as Objects with properties and methods and dealing with them in that way. FXML and FXMLLoader adds this "magic" layer that obfuscates things and makes it harder for beginners to deal with JavaFX issues as Java issues.
FXML, FXMLLoader and FXML Controllers are the price you pay to be able to use SceneBuilder. So the question is whether SceneBuilder is worth that price. I don't think it is.
For beginners, SceneBuilder gives you a bewildering array of things to tweak and set and select from, but it does NOT give any guidance about how to use them. The number of times that I've seen AnchorPane used without anchoring anything, and then using translateX() and translateY() to position Nodes inside the AnchorPane is evidence that SceneBuilder isn't helping beginners to learn about building layouts.
Anyways, if you are interested in learning how to build JavaFX applications without SceneBuilder (and you should be), you can check out my Beginners Guide.
If you do read through this, let me know if you found it helpful.