|
Friday, 30 April 2010
Using Thread in Java to Create Animation, Example 5
I said we use the paint() method to have a corner to creat my objects. Further I can have a class for my objects and create images there and bring them on my frame. I need only to pass the graphic of canvas to that class. Then I can even create more than one similar objects on the canvas and put them next together. I can have them resized and rotated and deformed. Now, I use some simple drawings and my aircraft bomber looks more real. I create it in a small sub-class to my canvas. Then I can call it from my paint() method. From this point you can use formalities of object-oriented languages for data encapsulations. But I prefer to experience with animations and put details of software engineering aside until I become fully fluent and in command of more basic details.
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.
Labels:
Animation,
Java Programming,
Threads
Subscribe to:
Post Comments (Atom)



0 comments:
Post a Comment