Using SceneBuilder and Controller class to change scenes in Javafx

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 147

  • @mezensboui4989
    @mezensboui4989 5 ปีที่แล้ว +74

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

    • @SafdarAliShah_TimeTraveler
      @SafdarAliShah_TimeTraveler 5 ปีที่แล้ว +1

      it seem it toke a lot of time for u...

    • @munteanionut3993
      @munteanionut3993 4 ปีที่แล้ว +1

      It took me a lot of time, too... like two weeks or so. I feel u man :))

  • @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

  • @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!

  • @joshuakoehler6457
    @joshuakoehler6457 3 ปีที่แล้ว

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

  • @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!

  • @ahmetgokpinar8635
    @ahmetgokpinar8635 4 ปีที่แล้ว

    BEST CODER IN THE ENTIRE WORLD. THANKS A LOT MAN

  • @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.

  • @tylerdurden7702
    @tylerdurden7702 2 ปีที่แล้ว

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

  • @mertkelleci1020
    @mertkelleci1020 3 ปีที่แล้ว

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

  • @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!

  • @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.

  • @christopherigbojekwe5966
    @christopherigbojekwe5966 6 ปีที่แล้ว

    Finally a clear and concise tutorial. Thanks a bunch!

  • @ОлексійКононенко-ч4ф
    @ОлексійКононенко-ч4ф 6 ปีที่แล้ว +1

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

  • @shumebegum3282
    @shumebegum3282 7 ปีที่แล้ว +7

    LIFE SAVER TUTORIAL! Thank you SO much!

  • @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.

  • @vuphong2003
    @vuphong2003 6 ปีที่แล้ว

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

  • @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

  • @meowmal506
    @meowmal506 2 ปีที่แล้ว

    thank you this is the only method that worked for me

  • @KroliczyKanal
    @KroliczyKanal 4 ปีที่แล้ว

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

  • @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.

  • @karolmks6950
    @karolmks6950 7 ปีที่แล้ว +1

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

  • @subedigaurav
    @subedigaurav 6 ปีที่แล้ว

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

  • @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.

  • @arifshariar5290
    @arifshariar5290 6 ปีที่แล้ว

    Best tutorial and easy to understand!

  • @AnkitGupta-fx4ur
    @AnkitGupta-fx4ur 6 ปีที่แล้ว

    You saved my project from the deathbed.

  • @pinnaclegamerslounge8815
    @pinnaclegamerslounge8815 3 ปีที่แล้ว

    Thank you so much!!! You saved my project

  • @neox7603
    @neox7603 4 ปีที่แล้ว +1

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

  • @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()

  • @naimsassine
    @naimsassine 5 ปีที่แล้ว +1

    Exaclty what i was looking for

  • @brunoxDzaum
    @brunoxDzaum 7 ปีที่แล้ว

    You saved my project! Thank you!

  • @m.noah01
    @m.noah01 4 ปีที่แล้ว

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

  • @mohamedaheddar5715
    @mohamedaheddar5715 4 ปีที่แล้ว

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

  • @hayden3774
    @hayden3774 3 ปีที่แล้ว

    Amazing explanation -- thank you!

  • @oyuntsetsegkbatsaikhan8924
    @oyuntsetsegkbatsaikhan8924 5 ปีที่แล้ว

    thank u only tutorial worked in my case

  • @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?

  • @isurugunatileka9850
    @isurugunatileka9850 6 ปีที่แล้ว

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

  • @afghaskjgasl
    @afghaskjgasl 6 ปีที่แล้ว

    Excellent video and explanation 👌🏻

  • @TheMrGais
    @TheMrGais 5 ปีที่แล้ว

    good content, nice quality, great work!

  • @munteanionut3993
    @munteanionut3993 4 ปีที่แล้ว

    Thanks a lot! God bless you, man!

  • @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.

  • @MegaPtrs
    @MegaPtrs 7 ปีที่แล้ว

    Splendid work !

  • @omaraitmlouk
    @omaraitmlouk 4 ปีที่แล้ว

    thanks brother you saved me again

  • @mustaphaELHOURA
    @mustaphaELHOURA 4 ปีที่แล้ว

    thanks sir, You are #1

  • @pradhumnapancholi4350
    @pradhumnapancholi4350 6 ปีที่แล้ว

    best method for teaching

  • @prof958
    @prof958 5 ปีที่แล้ว

    Thanks a lot man ! Worked so well !

  • @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?

  • @new.kotlet
    @new.kotlet 4 ปีที่แล้ว

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

  • @gustavoadolfogomezacevedo3905
    @gustavoadolfogomezacevedo3905 6 ปีที่แล้ว

    Thank you so much! great tutorial!

  • @ilianad.9499
    @ilianad.9499 6 ปีที่แล้ว

    Thank you for the videos!

  • @vladimiraloksova1440
    @vladimiraloksova1440 6 ปีที่แล้ว

    Thank you. Your code is working.

  • @NitrosS
    @NitrosS 6 ปีที่แล้ว +1

    Thank you Jaret

  • @mirodil.kamilov
    @mirodil.kamilov 4 ปีที่แล้ว +1

    Thanks a lot that relly helped

  • @murilo_no
    @murilo_no 24 วันที่ผ่านมา

    thank you so much for this

  • @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.

  • @annoremmanuel8764
    @annoremmanuel8764 2 ปีที่แล้ว

    Thank you very much sir

  • @truthteller2880
    @truthteller2880 6 ปีที่แล้ว

    saved me ... thank you very much

  • @amrabdulsalam4442
    @amrabdulsalam4442 4 ปีที่แล้ว

    your amazing bro thank you !!

  • @aidenyang747
    @aidenyang747 4 ปีที่แล้ว

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

  • @BDGKruger
    @BDGKruger 6 ปีที่แล้ว

    Thank you for this.

  • @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.

  • @tiagomoroni3040
    @tiagomoroni3040 5 ปีที่แล้ว

    Nice video man

  • @coderadventures6029
    @coderadventures6029 3 ปีที่แล้ว

    how to load the methods from the other scene controller

  • @phareze
    @phareze 4 ปีที่แล้ว

    thanks clean clean clean code

  • @minyoungyoo7265
    @minyoungyoo7265 4 ปีที่แล้ว

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

  • @manishkini9206
    @manishkini9206 6 ปีที่แล้ว +1

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

  • @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?

    • @jaretwright223
      @jaretwright223  4 ปีที่แล้ว

      Yes, that would be an elegant solution

  • @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

  • @raniacoco2168
    @raniacoco2168 4 ปีที่แล้ว

    oh thank you , you saved me !

  • @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!!

  • @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?

  • @مها-ظ2ط
    @مها-ظ2ط 6 ปีที่แล้ว

    please we need more videos about java

  • @mazenabouelhassen4913
    @mazenabouelhassen4913 4 ปีที่แล้ว

    Thanks a lot mate!

  •  5 ปีที่แล้ว

    my dude you saved me

  • @TechBleND97
    @TechBleND97 6 ปีที่แล้ว

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

  • @krazyninja954
    @krazyninja954 7 ปีที่แล้ว +1

    Thanks so much.

  • @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..

  • @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.

  • @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.

  • @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

  • @henrykay9259
    @henrykay9259 6 ปีที่แล้ว

    THANK YOU SIR!

  • @abdallahaloush427
    @abdallahaloush427 4 ปีที่แล้ว +1

    أحلى مسا عليك

  • @stefanheller3038
    @stefanheller3038 3 ปีที่แล้ว

    PERFEKT!!!

  • @ahmadalzohaile516
    @ahmadalzohaile516 4 ปีที่แล้ว

    Thanks a lot :)

  • @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.

  • @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

  • @ngquanhao1669
    @ngquanhao1669 6 ปีที่แล้ว

    Thank you!

  • @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.

  • @ОлексійКононенко-ч4ф
    @ОлексійКононенко-ч4ф 6 ปีที่แล้ว

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

  • @muizuvais
    @muizuvais 7 ปีที่แล้ว

    Is there a git repo where this code is stored?

  • @VarunRamanathan28031999
    @VarunRamanathan28031999 7 ปีที่แล้ว

    Thank you!!

  • @JunaidAhmed-ox2xd
    @JunaidAhmed-ox2xd 6 ปีที่แล้ว

    thank you sooooooooooooo much,

  • @VuiHọc-f7d
    @VuiHọc-f7d ปีที่แล้ว

    thanks a lot

  • @HeavyHouse24
    @HeavyHouse24 5 ปีที่แล้ว

    thank you