This section illustrates you how to create Animation. We are proving you an example defining a static variable DELAY of integer type. The object of Insets class is provides the representation of the borders i.e. left, right, top, bottom. the object of Timer class act as a thread which executes all the timer's tasks, sequentially.
The TimerTask class performs a task which can be scheduled for one-time or repeated execution by a Timer class. The method timer.schedule(timerTask, 0, DELAY) schedules the specified task for repeated fixed-delay execution.
The class Color defines an array of colors. The method fillRect() fills the rectangle with the colors showing animation.
Here is the code of CreateAnimation.java
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: December 15, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles