Force immediate paint in JavaFX

前端 未结 3 456
耶瑟儿~
耶瑟儿~ 2021-01-12 10:13

Is there a way to force a JavaFX app to repaint itself before proceeding? Similar to a Swing Panel\'s paint(Graphic g) method (I might be getting the keywords wrong there).<

3条回答
  •  梦谈多话
    2021-01-12 10:45

    JavaFX's model is to separate you from the painting of the "stuff" on the screen. This is very powerful but is a change from how you might be familiar with.

    whaley is correct that the appropriate way of doing this in JavaFX is to make a timeline where the move is done every X seconds and will be drawn at that keyframe.

    If you have a question about how to do this, try it and make a new question with some code.

提交回复
热议问题