Easy way to use multiple Fxml in JavaFX stage | Multiple Fxml loading Tutorial

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 71

  • @jam54
    @jam54 2 года назад +2

    Awesome tutorial, thank you so much for taking the time to explain every small step one by one

  • @saulernestopinales2990
    @saulernestopinales2990 3 года назад +2

    github repo?

  • @balazssipos941
    @balazssipos941 4 года назад +5

    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

    • @melindacsiki951
      @melindacsiki951 2 года назад +1

      hah, I wish - I get NullPointerException after I try switching to another scene...

  • @philipqueicuo3148
    @philipqueicuo3148 2 года назад

    This is a nice tutorial. Thanks so much for sharing.

  • @nml4546
    @nml4546 Год назад

    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.

  • @Enzhine
    @Enzhine 3 года назад +1

    Why is the new fxml does not change size in accordance with the main fxml's size?

  • @steveniu7139
    @steveniu7139 10 месяцев назад

    worked perfectly thank you

  • @bhavitakishanrajbhooma4706
    @bhavitakishanrajbhooma4706 3 года назад +2

    Hey can you please share the source code link?

  • @Pooja-ml8op
    @Pooja-ml8op Год назад

    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);

  • @MichaelSchubert_posts
    @MichaelSchubert_posts 3 года назад +2

    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.

  • @fatokitemiloluwa5973
    @fatokitemiloluwa5973 3 года назад +1

    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

  • @siddiqpratama6779
    @siddiqpratama6779 2 года назад

    How is fiil getresource, i try, always error, how it solve that. Result "page not exist'

  • @vinhnguyenhoang1006
    @vinhnguyenhoang1006 3 года назад +3

    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"?

    • @XxYoShIkOgAkIxX
      @XxYoShIkOgAkIxX 3 года назад +1

      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

    • @zimmtheking
      @zimmtheking 2 года назад

      @@XxYoShIkOgAkIxX Youre right, it will be gone.
      But how can I handle this???

    • @XxYoShIkOgAkIxX
      @XxYoShIkOgAkIxX 2 года назад

      @@zimmtheking I am sorry, it has been some time since I last used FXML and Java, I have no idea anymore. Good luck anyway :)

  • @ayaazkhanabid9053
    @ayaazkhanabid9053 4 года назад +1

    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

  • @David-h8o9v
    @David-h8o9v Год назад

    source code uploaded would be nice

  • @ferielmejri4939
    @ferielmejri4939 3 года назад +1

    hi sir can you plz share the code source i really need it so much for my graduation project

  • @Pooja-ml8op
    @Pooja-ml8op Год назад

    Please explain with a example if Screen1, Screen2, Screen3 diff components and controller classes.

  • @adzplus1
    @adzplus1 2 года назад

    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?

  • @miirshe
    @miirshe Год назад

    great job real full explanation I can`t see any else explain multiple form in javafx thanks all your support

  • @tvak9
    @tvak9 4 года назад +1

    Hi, have you shared the code somewhere?

  • @VenusYS
    @VenusYS 2 года назад +1

    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 .

    • @jfxdev267
      @jfxdev267 Год назад

      I have a problem and I haven't understand your explication ;please to clear

    • @VenusYS
      @VenusYS Год назад +1

      @@jfxdev267 i passed my exams and my projects, i dont remember anything anymore sorry i cant help you :')

  • @kienvuvan3714
    @kienvuvan3714 Год назад

    awesome, this is what i was looking for..... compared to many other videos this worked for me. thanks

  • @younow3353
    @younow3353 3 года назад

    When i add a controller to my page i face a Loadexception error please help me?!

  • @houimlinadine8249
    @houimlinadine8249 3 года назад

    big thanks

  • @robertholl8914
    @robertholl8914 4 года назад

    Could of really done with the source code for this rather than scrolling backwards and forwards through the video.

  • @MissMintyy
    @MissMintyy 4 года назад

    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😔

    • @AbidHussain-vo9cw
      @AbidHussain-vo9cw 4 года назад

      set the BorderPane id as mainPage
      Go to scene builder - > Choose the BorderPane -> Code on the right bottom side -> set fx:id to mainPane

  • @JuanMarcos.A
    @JuanMarcos.A 4 года назад +1

    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?

  • @mohamedaminedouik6560
    @mohamedaminedouik6560 3 года назад

    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

    • @mohamedaminedouik6560
      @mohamedaminedouik6560 3 года назад

      I found my issue, I'm calling the getClass().getResource("path") directely instead of Main.class.getClass().getResource("path")

  • @santosh050
    @santosh050 4 года назад

    Thank you

  • @elvirakutuzova4409
    @elvirakutuzova4409 3 года назад

    Thank you very much.

  • @witshells
    @witshells 4 года назад +1

    how to communicate between them?

    • @prabhathhettiarachchi9134
      @prabhathhettiarachchi9134 4 года назад

      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

  • @Kyokku84
    @Kyokku84 3 года назад

    Great tutorial, I've been searching for a while how to create a base layout, thanks a lot!

  • @gilbertcabigasalmazan3289
    @gilbertcabigasalmazan3289 2 года назад

    Source Code, Sir?

  • @tankeuful
    @tankeuful 3 года назад

    GREAT THANK YOU

  • @probaldeepsaikia
    @probaldeepsaikia 4 года назад +1

    Please share the source code.

    • @CoolITHelp
      @CoolITHelp  4 года назад +2

      Very soon we will update code of sample projects on out website coolithelp dot com.

  • @kwesiaryee
    @kwesiaryee 3 года назад

    Works perfect

  • @johndominicjasmin
    @johndominicjasmin 3 года назад

    Thank you so much bro

  • @prathamsarankar-csecs-0398
    @prathamsarankar-csecs-0398 4 года назад

    Thank you very much

  • @saharsaleh7912
    @saharsaleh7912 3 года назад

    thank you a lot

  • @telegramvideos1313
    @telegramvideos1313 3 года назад

    Thanks alot !

  • @hegelmotokoua
    @hegelmotokoua 3 года назад

    Thanks you so much !

  • @bacanalienigena
    @bacanalienigena 3 года назад

    2021 It's still working beautifully, thanks a million! 🖖😎

    • @mohamedaminedouik6560
      @mohamedaminedouik6560 3 года назад +1

      Hello did you try to export your jar and test ?
      Thank you

    • @bacanalienigena
      @bacanalienigena 3 года назад

      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.

    • @mohamedaminedouik6560
      @mohamedaminedouik6560 2 года назад

      @@bacanalienigena thank you for your reply

  • @manalbenchrif2961
    @manalbenchrif2961 4 года назад

    i got an error when i associate methode onclick to my buttum

    • @NarturArkano
      @NarturArkano 3 года назад

      Do it "OnAction," not "OnClick."

  • @deathkryz
    @deathkryz 4 года назад

    Good example, thanks

  • @abdessalemkheyar3619
    @abdessalemkheyar3619 4 года назад

    hey i am at 11:04
    and object.getPage doesn't work !

    • @yrbtt
      @yrbtt 4 года назад +1

      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();"

  • @karanshedge514
    @karanshedge514 4 года назад

    Which JDK u are you using or which JFx are you using?

    • @randomnet8149
      @randomnet8149 4 года назад

      thats netbeans 8.0, but I think intellij Idea is much faster and intuitive

  • @viral_codes
    @viral_codes 4 года назад

    Thanks !!!

  • @NeslyCastro
    @NeslyCastro 4 года назад

    Great job!

  • @nevermore5173
    @nevermore5173 4 года назад

    Speak faster for God's sake

  • @piakaroline362
    @piakaroline362 4 года назад

    Where is the load method?

    • @xlughx
      @xlughx 4 года назад +1

      There is a FXMLLoader class and a FxmlLoader class