Using SceneBuilder and Controller class to change scenes in Javafx

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ •

  • @mezensboui4989
    @mezensboui4989 5 років тому +74

    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

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

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

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

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

  • @ahmetgokpinar8635
    @ahmetgokpinar8635 4 роки тому

    BEST CODER IN THE ENTIRE WORLD. THANKS A LOT MAN

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

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

  • @ОлексійКононенко-ч4ф
    @ОлексійКононенко-ч4ф 5 років тому +1

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

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

  • @shumebegum3282
    @shumebegum3282 7 років тому +7

    LIFE SAVER TUTORIAL! Thank you SO much!

  • @christopherigbojekwe5966
    @christopherigbojekwe5966 6 років тому

    Finally a clear and concise tutorial. Thanks a bunch!

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

  • @yamamjn9988
    @yamamjn9988 4 роки тому +1

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

  • @meowmal506
    @meowmal506 2 роки тому

    thank you this is the only method that worked for me

  • @karolmks6950
    @karolmks6950 7 років тому +1

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

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

  • @Jredivo
    @Jredivo 7 років тому +1

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

  • @KroliczyKanal
    @KroliczyKanal 4 роки тому

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

  • @neox7603
    @neox7603 4 роки тому +1

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

  • @subedigaurav
    @subedigaurav 6 років тому

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

  • @AnkitGupta-fx4ur
    @AnkitGupta-fx4ur 6 років тому

    You saved my project from the deathbed.

  • @emrebasar3129
    @emrebasar3129 3 роки тому

    God just bless you. You are an awesome guy.

  • @pinnaclegamerslounge8815
    @pinnaclegamerslounge8815 3 роки тому

    Thank you so much!!! You saved my project

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

  • @arifshariar5290
    @arifshariar5290 5 років тому

    Best tutorial and easy to understand!

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

  • @afghaskjgasl
    @afghaskjgasl 6 років тому

    Excellent video and explanation 👌🏻

  • @m.noah01
    @m.noah01 4 роки тому

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

  • @hayden3774
    @hayden3774 3 роки тому

    Amazing explanation -- thank you!

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

  • @isurugunatileka9850
    @isurugunatileka9850 6 років тому

    Thank you so much bro...You're a 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?

  • @brunoxDzaum
    @brunoxDzaum 7 років тому

    You saved my project! Thank you!

  • @oyuntsetsegkbatsaikhan8924
    @oyuntsetsegkbatsaikhan8924 5 років тому

    thank u only tutorial worked in my case

  • @pradhumnapancholi4350
    @pradhumnapancholi4350 6 років тому

    best method for teaching

  • @mohamedaheddar5715
    @mohamedaheddar5715 4 роки тому

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

  • @new.kotlet
    @new.kotlet 4 роки тому

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

  • @mustaphaELHOURA
    @mustaphaELHOURA 4 роки тому

    thanks sir, You are #1

  • @naimsassine
    @naimsassine 5 років тому +1

    Exaclty what i was looking for

  • @omaraitmlouk
    @omaraitmlouk 4 роки тому

    thanks brother you saved me again

  • @MegaPtrs
    @MegaPtrs 7 років тому

    Splendid work !

  • @manishkini9206
    @manishkini9206 6 років тому +1

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

  • @aidenyang747
    @aidenyang747 4 роки тому

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

  • @munteanionut3993
    @munteanionut3993 4 роки тому

    Thanks a lot! God bless you, man!

  • @gustavoadolfogomezacevedo3905
    @gustavoadolfogomezacevedo3905 6 років тому

    Thank you so much! great tutorial!

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

  • @TheMrGais
    @TheMrGais 5 років тому

    good content, nice quality, great work!

  • @ilianad.9499
    @ilianad.9499 6 років тому

    Thank you for the videos!

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

  • @murilo_no
    @murilo_no 15 днів тому

    thank you so much for this

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

  • @phareze
    @phareze 4 роки тому

    thanks clean clean clean code

  • @stefanheller3038
    @stefanheller3038 3 роки тому

    PERFEKT!!!

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

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

  • @مها-ظ2ط
    @مها-ظ2ط 6 років тому

    please we need more videos about java

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

  • @minyoungyoo7265
    @minyoungyoo7265 4 роки тому

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

  • @BDGKruger
    @BDGKruger 6 років тому

    Thank you for this.

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

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

  • @prof958
    @prof958 5 років тому

    Thanks a lot man ! Worked so well !

  • @krazyninja954
    @krazyninja954 7 років тому +1

    Thanks so much.

  • @mazenabouelhassen4913
    @mazenabouelhassen4913 4 роки тому

    Thanks a lot mate!

  • @abdallahaloush427
    @abdallahaloush427 4 роки тому +1

    أحلى مسا عليك

  • @coderadventures6029
    @coderadventures6029 3 роки тому

    how to load the methods from the other scene controller

  •  5 років тому

    my dude you saved me

  • @raniacoco2168
    @raniacoco2168 4 роки тому

    oh thank you , you saved me !

  • @henrykay9259
    @henrykay9259 6 років тому

    THANK YOU SIR!

  • @TechBleND97
    @TechBleND97 6 років тому

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

  • @viejowaterfall2
    @viejowaterfall2 7 років тому

    thank you . perfect

  • @ahmadalzohaile516
    @ahmadalzohaile516 4 роки тому

    Thanks a lot :)

  • @ngquanhao1669
    @ngquanhao1669 6 років тому

    Thank you!

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

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

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

  • @tiagomoroni3040
    @tiagomoroni3040 5 років тому

    Nice video man

  • @VarunRamanathan28031999
    @VarunRamanathan28031999 7 років тому

    Thank you!!

  • @VuiHọc-f7d
    @VuiHọc-f7d Рік тому

    thanks a lot

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

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

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

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

  • @HeavyHouse24
    @HeavyHouse24 4 роки тому

    thank you

  • @alejandrosolis479
    @alejandrosolis479 7 років тому

    thank you!

  • @JunaidAhmed-ox2xd
    @JunaidAhmed-ox2xd 6 років тому

    thank you sooooooooooooo much,

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

  • @raquelmelo3788
    @raquelmelo3788 6 років тому

    THANK YOU