JavaFX Slide Transition Animation for Scenes

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • JavaFX scene changing / transition animation with slide in effect. This tutorial talk about implementing slide transition animation for javafx scenes. This is done with the help of KeyFrame animation.
    Read more about JavaFX Animation: www.genuinecode...
    The new scene will be first added to the current root at end of window. Then using KeyFrame animation, we gradually decrement either the translateX property or translateY property to create the slide animation.
    The sliding transition can be created from any direction. The direction can be controlled by setting translateX and translateY property.
    Code is available in GitHub: github.com/afs...
    - Genuine Coder
    www.genuinecoder.com

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

  • @heliobarcelos3949
    @heliobarcelos3949 6 лет назад +8

    Your work is very good, congratulations. I've learned a lot from your videos.

  • @ZeeshanKhan-fw6iv
    @ZeeshanKhan-fw6iv 4 года назад +1

    Can you post code for scenes not built with Scene builder but rather plain code

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

    Thanks for the video

  • @mayumimiyazato5741
    @mayumimiyazato5741 5 лет назад +3

    Hey, just a question: how do I do to the scene go from the top to the bottom? Sorry, I'm new on this :v
    Btw, thank you for your tutorial! It helped me a lot!

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

      Just give the y value the minus scene height and start incrementing it

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

      ​@@yasserelezaar7559 I spent around of two hours searching that answer and i finally found it in this comment.. thanks.

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

    I get an error "Cannot invoke "javafx.scene.control.Button.getScene()" because "this.button" is null". Any possible fix?

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

    Very nice video. But what if i want my 2nd scene to cover only a portion of 1st? How can i do that?
    And also it would be great if you show me how to exit 2nd scene by sliding down

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

    After doing web development for more than 3 years i have had issues with learning this. Java is its own beast and i am very greatfull you have made this video man. Thank you so much. you are helping me with my uni asignment.

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

    i have a problem when i load the second scene the items from the previous scene are still there and move on the second scene

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

    You are the best

  • @slasladuplo4
    @slasladuplo4 6 лет назад +2

    so how do I roll back to the first page with the stack pane?

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

      same quiz

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

      @@UthpalaBandaradoor do the same but now change the relative path of the fxml

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

    A quite tricky Technique...

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

    quite good explanation....

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

    hey nice video! I do this for an application to switch scenes but when i make the first 2 or 3 switches the animation seems a bit cluncky. The more i switch the scenes the smoother the animation gets. Do you know what could possible cause this problem?

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

    hi bro can i create this kind of animation in java swing?

  • @mr.RAND5584
    @mr.RAND5584 4 года назад

    Request si for the bigger font code. ☺️

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

    Nice work
    keep going

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

    Plz zoom in while you record

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

    King of the Transition

  • @JaskaranSingh-oj2uq
    @JaskaranSingh-oj2uq 5 лет назад

    can i do the same thing for a video??? like play one video and the end of it wipe the other video(i.e joining the two video)

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

      you will need a function that call the method of the transition when the video finishes, i think you need a library to found that function.

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

    Nice, I think they use this idea for one of my projects

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

    it is possible to apply this in swing?

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

      i don't think so, he used scenes to do this animations , the scenes are only used with JavaFX

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

    nice video. i was wondering is there a way to access scene 1 after calling scene 2 without duplicating another scene 1?

    • @7starj
      @7starj 4 года назад

      same question

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

    I've got an error with the *_seconds_* on Duration.seconds
    it says it cannot find symbol 😥. BTW. nice tutorials

    • @GenuineCoder
      @GenuineCoder  5 лет назад +3

      If your error is in animation duration setting, your import must be wrong.
      Use --> "javafx.util.Duration"
      Not --> "java.time.Duration"

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

      @@GenuineCoder You really are a Programmer. Hoping to be like you someday 😊😍
      *THANK YOU SO MUCH*
      new at JavaFX, and this is my 3 straight days on learning it. So cool.

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

      @@GenuineCoder Thanks for the Library Management System you've made. I've learned a lot from it. Though, I am using SQL Server as back end database 😊

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

      Thanks.
      I am just more experienced with these things over years of projects and hobby-coding.
      With time you could get better and better at it and you will make even more awesome applications. All the best.