Using SceneBuilder and Controller class to change scenes in Javafx

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

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

  • @mezensboui4989
    @mezensboui4989 5 лет назад +73

    GOD BLESS YOU MAN I SEARCHED ALL MY ENTIRE LIFE FOR THIS

  • @joshuabermudez2372
    @joshuabermudez2372 6 лет назад +21

    OMFG YESS!!! Thank you so much for giving us this video!!! I have looked, for THREE DAYS, in the darkest deepest corners of the internet, in my university course's lectures, and in THREE different Java books to find out how to change scenes in JavaFX. You are, LITERALLY, the ONLY person I could find who will explain this concept in plain English! Thanks!

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

    THANK YOU !!!!! I have looked for FIVE DAYS, in the darkest deepest cornes of the internet, in my university course's lectures, and in TWENTY different Java books to find how to change scenes in JavaFX. YOU are, LITERALLY, the ONLY person I could find who will explain this concept in plain English !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @MrMadAddam
    @MrMadAddam 6 лет назад +5

    This is one of those unique tutorials out there that also explains WHY we are writing that code and what it's actually doing. Thank you for that! it helped up clear a lot of confusion

  • @JaimeUnKiwi
    @JaimeUnKiwi 5 лет назад +28

    Thanks a lot! Worked like a charm.
    Just in case someone runs into the same problem as I did : Location is required.
    I have my views located into a package called "view", so I had to adapt the path like so :
    Parent viewParent = FXMLLoader.load(getClass().getResource("/view/Example.fxml"));
    Cheers.

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

      You're a lifesaver

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

      THANK YOU

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

      THANK YOU :D I thought I was officially stupid enough I couldn't follow a youtube tutorial - just needed the location!

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

    thank you man, i just passed two days (8 hours a day) (I am a beginner) searching on the internet to move between scens in the same stage and finaly in just 15 min i did it !!!. You deserve respect man and you gained another subscription.

  • @funfunfact2950
    @funfunfact2950 7 лет назад +31

    best tutorial on javafx

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

    Great tutorial. I learned more in 15 minutes watching this than I did in my Java I Course over 3 chapters. Thank you for doing such great work!

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

    Fantastic tutorial. Thank you so much for explaining why do we do the things we do and how everything work.

  • @olgierdbogusz9698
    @olgierdbogusz9698 5 лет назад +1

    I think you just saved me a few hours with this video. Project is due tommorow. Thank you so much man.

  • @TheMitsosS
    @TheMitsosS 7 лет назад

    Oh man!!! I've been struggling to change since for a day!!! All the other videos are too confusing!! Well done! Life saver tutorial!

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

    Real explanation starts at 6:41
    @Jaret_Wright Thanks for this, its really helpful!

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

    Thank you soo much, I was looking exactly for this and this video really helped me a lot. Very nicely explained you deserve a like.
    Tip for others: Just make sure you import the correct library, need the javafx one, other's won't be compatible. I unknowingly imported java awt library due to auto import and that error costed me a lot of time.

  • @allanowino7597
    @allanowino7597 6 лет назад

    Thanks man. I went through lots of youtube videos trying to get a solution to what you have shown on the video

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

    BEST CODER IN THE ENTIRE WORLD. THANKS A LOT MAN

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

    The only method on youtube that worked for me, thank you very much!!!

  • @ОлексійКононенко-ч4ф

    Наконец открыл для себя javafx. Видео помогли решить проблемы с таблицами и переходами между окнами.

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

    Thanks a lot! Took me forever to be able to do this

  • @ExarchiasGhost
    @ExarchiasGhost 5 лет назад

    Jaret you are my Hero and definitely a great programmer and lecturer.

  • @christopherigbojekwe5966
    @christopherigbojekwe5966 6 лет назад

    Finally a clear and concise tutorial. Thanks a bunch!

  • @shumebegum3282
    @shumebegum3282 7 лет назад +7

    LIFE SAVER TUTORIAL! Thank you SO much!

  • @vuphong2003
    @vuphong2003 6 лет назад

    this tutorial is a lifesaver
    It helped me out with my school project

  • @new.kotlet
    @new.kotlet 4 года назад

    Thank you very much ! Btw which book you prefer to learn quickly JavaFX in advanced level?

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

    Just to offer an alternative solution, I like to make a scene controller class. This class keeps track of the stage and scene and has a function for switching scenes.

  • @auracular
    @auracular 5 лет назад +2

    If you're getting an error saying that "Location is required" and the pointer is null, replace "getClass().getResource()" with "getClass().getClassLoader().getResource()

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

    thank you this is the only method that worked for me

  • @AnkitGupta-fx4ur
    @AnkitGupta-fx4ur 6 лет назад

    You saved my project from the deathbed.

  • @ukagilly8463
    @ukagilly8463 7 лет назад +3

    The problems I have had trying to do this...Life saver isn't the word...stuck for weeks scratching my head at this one.

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

    Omg I was looking for this whole day! God bless you mate ✌️

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

    Thank you so much!!! You saved my project

  • @karolmks6950
    @karolmks6950 7 лет назад +1

    You are amazing! Damn, i was fighting with that staff whole day! :D Thank You very much!

  • @Jredivo
    @Jredivo 7 лет назад +1

    Thank you so much dude! This is so helping me with my final project

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

    God just bless you. You are an awesome guy.

  • @szilike_10
    @szilike_10 4 года назад +3

    The moment I add the parameter ActionEvent to the controlling method of the button, I get tons of errors and exceptions. Why is that?

  • @subedigaurav
    @subedigaurav 6 лет назад

    Thanks Jaret! This video saved me a lot of time.

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

    Thank you very much man, really good tutorial, well explained

  • @arifshariar5290
    @arifshariar5290 5 лет назад

    Best tutorial and easy to understand!

  • @afghaskjgasl
    @afghaskjgasl 6 лет назад

    Excellent video and explanation 👌🏻

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

    thank you soooooo much it take me 2 days to find this video,,please i have a question ii want theb second scene show in center of first scene any help!!

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

    Amazing explanation -- thank you!

  • @m.noah01
    @m.noah01 3 года назад

    OOOOMMMMGGGG my buddy you are my life saver....!!!!

  • @Ruvindra960518
    @Ruvindra960518 5 лет назад +2

    When I maximize the first window and then go to the second scene, the window doesn't stay maximized. It reduces to the second scene's original(pref) size. How can I prevent this from happening?

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

    thanks sir, You are #1

  • @oyuntsetsegkbatsaikhan8924
    @oyuntsetsegkbatsaikhan8924 5 лет назад

    thank u only tutorial worked in my case

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

    أحلى مسا عليك

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

    it's really nice to watch it in 1.25 speed FYI

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

    thanks brother you saved me again

  • @pradhumnapancholi4350
    @pradhumnapancholi4350 6 лет назад

    best method for teaching

  • @downfall991
    @downfall991 5 лет назад

    Thank you! It works perfectly. But how do you make this work with servers. Depending on messages from server the GUI should follow certain instructions, like changing scene.

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

    thank you so much for this video ! God bless you !

  • @MegaPtrs
    @MegaPtrs 6 лет назад

    Splendid work !

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

    Thanks a lot! God bless you, man!

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

    Thank you very much sir

  • @brunoxDzaum
    @brunoxDzaum 7 лет назад

    You saved my project! Thank you!

  • @isurugunatileka9850
    @isurugunatileka9850 6 лет назад

    Thank you so much bro...You're a life saver!!! 👍

  • @TheMrGais
    @TheMrGais 5 лет назад

    good content, nice quality, great work!

  • @naimsassine
    @naimsassine 5 лет назад +1

    Exaclty what i was looking for

  • @manishkini9206
    @manishkini9206 6 лет назад +1

    Why this Shows Me an Error onActon (Controller is not defined on root component)

  • @NitrosS
    @NitrosS 6 лет назад +1

    Thank you Jaret

  • @مها-ظ2ط
    @مها-ظ2ط 6 лет назад

    please we need more videos about java

  • @jahnavimuddasani9497
    @jahnavimuddasani9497 6 лет назад

    From where should we access the controls of second scene? Like if i have a textfield in second scene and on the click of the button in first scene , the second scene should appear with some input in the textfield which i would give in the code.

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

    if i have multiple scenes, it would be better to create an interface with that method and make all controllers extend the interface, right?

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

    thanks clean clean clean code

  • @ilianad.9499
    @ilianad.9499 6 лет назад

    Thank you for the videos!

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

    how to load the methods from the other scene controller

  • @vladimiraloksova1440
    @vladimiraloksova1440 6 лет назад

    Thank you. Your code is working.

  • @tiagomoroni3040
    @tiagomoroni3040 5 лет назад

    Nice video man

  • @mirodil.kamilov
    @mirodil.kamilov 4 года назад +1

    Thanks a lot that relly helped

  • @gustavoadolfogomezacevedo3905
    @gustavoadolfogomezacevedo3905 6 лет назад

    Thank you so much! great tutorial!

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

    your amazing bro thank you !!

  • @truthteller2880
    @truthteller2880 6 лет назад

    saved me ... thank you very much

  • @prof958
    @prof958 5 лет назад

    Thanks a lot man ! Worked so well !

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

    PERFEKT!!!

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

    I was success full for doing it for 1 button , but when i did it for multiple button it gave me error

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

    Thanks a lot mate!

  • @BDGKruger
    @BDGKruger 6 лет назад

    Thank you for this.

  •  5 лет назад

    my dude you saved me

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

    Good

  • @muxiu222
    @muxiu222 5 лет назад

    I followed the steps, but it didn't work when I tried to go back from table view to gui view, any idea why is that?

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

    Thanks a lot :)

  • @krazyninja954
    @krazyninja954 6 лет назад +1

    Thanks so much.

  • @henrykay9259
    @henrykay9259 6 лет назад

    THANK YOU SIR!

  • @ivirus-xii6158
    @ivirus-xii6158 4 года назад

    why do i get an exception error. the exception is telling me error on the parent root line when my fxml is working fine

  • @TechBleND97
    @TechBleND97 5 лет назад

    how I can do that but with an image instead a button?

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

    oh thank you , you saved me !

  • @VuiHọc-f7d
    @VuiHọc-f7d Год назад

    thanks a lot

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

    if I got InvocationTargetException, what do I have to fix?

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

    thank you

  • @ngquanhao1669
    @ngquanhao1669 6 лет назад

    Thank you!

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

    what should I do if it gives me nullpointerException at stage.setTtitle(title); ?

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

      You have 2 variables, stage and title. One of those variables has not been initialized. Try changing the variable title to “the title”. If that works, you know the variable title was null. If it still shows a null pointer exception, the stage was your issue.

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

      @@CelebratingFun Thank you! The stage was my issue.

  • @paryk144
    @paryk144 7 лет назад

    Can someone tell me how to add more than one button with change scene action?
    How to code this in controller?
    1 button works correctly, but other one not.

  • @balasubramanyam1912
    @balasubramanyam1912 6 лет назад +1

    Sir actually when i am trying to convert that node line of code... Its giving error like node can't be resolved to type. What should i do please help me

    • @giuliopimenoff
      @giuliopimenoff 6 лет назад

      can u write the code here?

    • @henrykay9259
      @henrykay9259 6 лет назад

      Same with mine

    • @henrykay9259
      @henrykay9259 6 лет назад

      warning not error use eclipse

    • @henrykay9259
      @henrykay9259 6 лет назад

      Sorry I meant and I use Eclipse and it gives a warning not an error

    • @henrykay9259
      @henrykay9259 6 лет назад +1

      All you need do is import javafx.scene.Node
      I had the same issue and I was stuck cuz I'm used to eclipse telling me what to import and this time they didn't so..

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

    Heyy. Im doing this and it not working. I'm getting an error that says "JavaFX runtime components are missing, and are required to run this application". I don't know what to do please helpp

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

      add the module path on the run > run configurations > arguments

  • @viejowaterfall2
    @viejowaterfall2 7 лет назад

    thank you . perfect

  • @ryanstern5359
    @ryanstern5359 6 лет назад

    what if the arrow button doesnt appear on scene builder when hooking up the button with the function?

    • @jaretwright223
      @jaretwright223  6 лет назад

      If you are referring to the drop down menu where you typically select the method (i.e. you have clicked on the button and selected "code" from the accordian on the right side of the screen), then you most likely have not saved the method in your controller class. So just go back into Netbeans or Intellij (whatever your IDE is) and hit save.

  • @VarunRamanathan28031999
    @VarunRamanathan28031999 7 лет назад

    Thank you!!

  • @alejandrosolis479
    @alejandrosolis479 7 лет назад

    thank you!

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

    i'm getting mad errors and scene will no load when button is clicked. Double checked all the code and everything is correctly tagged in scene builder =(

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

      However, I can only run project from main.java file it won't let me run file on fxmlDocumentController.java because it doesn't have a main class? any help would be much appreciated.

  • @ОлексійКононенко-ч4ф

    Спасибо, все ясно и практично

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

    thank u