Howdy folks,
Forgive my complete ignorance, but I just decided to start learning JavaFX. I created the basic project and started playing with it, and noticed something funny. When I tried to add a second button, it was placed on top of the old one, which I thought was weird, but the strangest thing happened when I commented out the code to actually add that button to the scene! Here's the code:
As you can see, I commented out the addition of btn2, but left the implementation. I was really just experimenting and seeing what I can do. (The lambda expression was autogenerated for me by NetBeans so I don't know if that has any effect on this.) Basically what happens is if I run the code, the Goodbye World button (btn2) is added and is fully functional!? What's even stranger to me is when I uncomment btn2 and comment out btn1 I get a small button with nothing written on it and no functionality.
If anyone could please explain what's going on here, it would help me immensely in figuring this thing out. If FX is supposed to replace Swing I am going to have to start learning this sooner or later
Thanks in advance!