If you get NullPointerException, it might be becouse, you didn't set the mainPane to the BorderPane in Scene builder. Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane
I don't know if he mentions it in the video, but the Controller for Screens 1,2 and 3 needs to be FXMLDocumentController. Do not create separate controllers for screens 1, 2, and 3.
How we will access Controller in case Screen1, Screen2, Screen3 have different controller suppose we have this statement and we pass Screen1, Screen2, Screen3 Parent root = FXMLLoader.load(getClass().getResource(page + ".fxml")); and replace in second statement, in this case how to get controller class object from Screen1, Screen2, Screen3 bp.setCenter(root);
It works perfect! My dynamically loaded complex sub-panes are resizing as they should. MANY THANKS!!! If Scene Builder is correctly integrated with NetBeans, to open one or multiple fxml files just double click them or right click/open them within multiple Scene Builder instances in parallel.
Hi, thank you so much! I have a question, if screen 1 has text field with value ="hihi" (I typing it), I change screen 2 and reselect screen 1 is text field has old value="hihi"?
Hello sir, I have a request you to do a tutorial on the topic how to open a form and if that particular form is already open and clicking the button again then close the first and open new same form or give an alert box that the window is already displayed and after clicking on the OK bring that particular opened stage to font, if you do this it well be very kind of you because I'm only stuck on this point, WAITING FOR YOUR REPLY, THANKS
But my question is can you load many stages all at the same time with JavaFX? In other words...can you open a main window and from that main window it opens other windows that are part of the application but independent from the main window?
Explanation for those who have problems : Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane There is a FXMLLoader class and a FxmlLoader class. You need to create FxmlLoader (with lowercase L) and import the FXMLLoader (with uppercase L). You will use the load method from FXMLLoader, dont create FXMLLoader and load method like me. Create FxmlLoader .
Hey i have a Problem i tied to Programm this but it dosent Work. I know this is because the screen1 screen2 ect. Are not found. I have write it like you and tried to print the URL with sysout and in the konsol was displayed "null" please help me an sorry for my bad english😔
Hi, thanks for your sharing, I have one question, every time you change the scene you create a new instance of FxmlLoader, is that right? if it is, do you know some way to handle that?
Hello, Thank you for this tutorial, I have an issue, when I try to run from eclipse it's working fine but when I export my package I only have the main screen with buttons wen I click on button I don't have nothing
Same here. How he load fxml without fxml controllers. Everytime created a new fxml its need controller class. 🙄 i think just a fxml load . it cannot communication between them
Hi @@mohamedaminedouik6560 Not yet, as I'm learning how to send information between scenes so understanding the FXML loader process + Scenebuilder and something else as I've discover recently the advantages using Maven, Spring Boot, it's a good bit of learning progress. I'm building up on top of your video information. Thanks again.
You created an FXMLLoader "object" instead of an FxmlLoader "object". You can avoid this confusion completely by renaming the FxmlLoader class he creates around 8:00 to something else, like PageLoader, then in the code at 11:04 you would change the line "FxmlLoader object = new FxmlLoader();" to "PageLoader object = new PageLoader();"
Awesome tutorial, thank you so much for taking the time to explain every small step one by one
github repo?
If you get NullPointerException, it might be becouse, you didn't set the mainPane to the BorderPane in Scene builder.
Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane
hah, I wish - I get NullPointerException after I try switching to another scene...
This is a nice tutorial. Thanks so much for sharing.
I don't know if he mentions it in the video, but the Controller for Screens 1,2 and 3 needs to be FXMLDocumentController. Do not create separate controllers for screens 1, 2, and 3.
Why is the new fxml does not change size in accordance with the main fxml's size?
worked perfectly thank you
Hey can you please share the source code link?
How we will access Controller in case Screen1, Screen2, Screen3 have different controller
suppose we have this statement and we pass Screen1, Screen2, Screen3
Parent root = FXMLLoader.load(getClass().getResource(page + ".fxml"));
and replace in second statement, in this case how to get controller class object from Screen1, Screen2, Screen3
bp.setCenter(root);
It works perfect! My dynamically loaded complex sub-panes are resizing as they should.
MANY THANKS!!!
If Scene Builder is correctly integrated with NetBeans, to open one or multiple fxml files just double click them or right click/open them within multiple Scene Builder instances in parallel.
I dont feel this is the best way to explain this, i have no idea about what you are doing and you should have explained from scratch
How is fiil getresource, i try, always error, how it solve that. Result "page not exist'
Hi, thank you so much!
I have a question, if screen 1 has text field with value ="hihi" (I typing it), I change screen 2 and reselect screen 1 is text field has old value="hihi"?
I have not watched the whole video, but I assume the person in the video just reloads the fxml file everytime. So no, it will be gone
@@XxYoShIkOgAkIxX Youre right, it will be gone.
But how can I handle this???
@@zimmtheking I am sorry, it has been some time since I last used FXML and Java, I have no idea anymore. Good luck anyway :)
Hello sir, I have a request you to do a tutorial on the topic how to open a form and if that particular form is already open and clicking the button again then close the first and open new same form or give an alert box that the window is already displayed and after clicking on the OK bring that particular opened stage to font, if you do this it well be very kind of you because I'm only stuck on this point, WAITING FOR YOUR REPLY, THANKS
source code uploaded would be nice
hi sir can you plz share the code source i really need it so much for my graduation project
Please explain with a example if Screen1, Screen2, Screen3 diff components and controller classes.
But my question is can you load many stages all at the same time with JavaFX?
In other words...can you open a main window and from that main window it opens other windows that are part of the application but independent from the main window?
great job real full explanation I can`t see any else explain multiple form in javafx thanks all your support
Hi, have you shared the code somewhere?
Explanation for those who have problems :
Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane
There is a FXMLLoader class and a FxmlLoader class. You need to create FxmlLoader (with lowercase L) and import the FXMLLoader (with uppercase L). You will use the load method from FXMLLoader, dont create FXMLLoader and load method like me. Create FxmlLoader .
I have a problem and I haven't understand your explication ;please to clear
@@jfxdev267 i passed my exams and my projects, i dont remember anything anymore sorry i cant help you :')
awesome, this is what i was looking for..... compared to many other videos this worked for me. thanks
When i add a controller to my page i face a Loadexception error please help me?!
big thanks
Could of really done with the source code for this rather than scrolling backwards and forwards through the video.
Hey i have a Problem i tied to Programm this but it dosent Work. I know this is because the screen1 screen2 ect. Are not found. I have write it like you and tried to print the URL with sysout and in the konsol was displayed "null" please help me an sorry for my bad english😔
set the BorderPane id as mainPage
Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane
Hi, thanks for your sharing, I have one question, every time you change the scene you create a new instance of FxmlLoader, is that right? if it is, do you know some way to handle that?
create static method.
Hello, Thank you for this tutorial,
I have an issue, when I try to run from eclipse it's working fine but when I export my package I only have the main screen with buttons wen I click on button I don't have nothing
I found my issue, I'm calling the getClass().getResource("path") directely instead of Main.class.getClass().getResource("path")
Thank you
Thank you very much.
how to communicate between them?
Same here. How he load fxml without fxml controllers. Everytime created a new fxml its need controller class. 🙄 i think just a fxml load . it cannot communication between them
Great tutorial, I've been searching for a while how to create a base layout, thanks a lot!
Source Code, Sir?
GREAT THANK YOU
Please share the source code.
Very soon we will update code of sample projects on out website coolithelp dot com.
Works perfect
Thank you so much bro
Thank you very much
thank you a lot
Thanks alot !
Thanks you so much !
You're welcome!
2021 It's still working beautifully, thanks a million! 🖖😎
Hello did you try to export your jar and test ?
Thank you
Hi @@mohamedaminedouik6560 Not yet, as I'm learning how to send information between scenes so understanding the FXML loader process + Scenebuilder and something else as I've discover recently the advantages using Maven, Spring Boot, it's a good bit of learning progress. I'm building up on top of your video information. Thanks again.
@@bacanalienigena thank you for your reply
i got an error when i associate methode onclick to my buttum
Do it "OnAction," not "OnClick."
Good example, thanks
hey i am at 11:04
and object.getPage doesn't work !
You created an FXMLLoader "object" instead of an FxmlLoader "object". You can avoid this confusion completely by renaming the FxmlLoader class he creates around 8:00 to something else, like PageLoader, then in the code at 11:04 you would change the line "FxmlLoader object = new FxmlLoader();" to "PageLoader object = new PageLoader();"
Which JDK u are you using or which JFx are you using?
thats netbeans 8.0, but I think intellij Idea is much faster and intuitive
Thanks !!!
Great job!
Speak faster for God's sake
Where is the load method?
There is a FXMLLoader class and a FxmlLoader class