Monday, 12 April 2010

Using Thread in Java to Create Animation, Example 3

Now, we are at a point to create animation on our canvas without using an image; doing it just by painting. Still we use the tick-tack technique between run() method and the other() method. Here we have to add a paint() method to create the desired object for us, we put a small red blob, an oval shape on the canvas, moving from left to right. The canvas is a java swing panel.

Click here to see the application. If you save the "jar" file in your computer you can use "7z" decompression utility to extract source file and image files.

0 comments:

Post a Comment