Simple animations in Java

前端 未结 4 729
滥情空心
滥情空心 2021-01-28 15:14

I\'m attempting to code a simple animation or physics example in a Java Swing application. I have the actual windows application open and working, but I can\'t figure out how to

4条回答
  •  面向向阳花
    2021-01-28 15:55

    Take a look at the Swing tutorial on Custom Painting.

    The example shows you how to do painting. If you want animation, then you would use a Swing Timer to schedule the animation. The tutorial also has a section on How to use a Swing Timer.

    Put the two tutorial together and you have a solution.

提交回复
热议问题