Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: javax.swing.Timer

A javax.swing.Timer object calls an action listener at regular intervals or only once.

Tutorial Details:

A javax.swing.Timer object calls an action listener at regular intervals or only once. For example, it can be used to show frames of an animation many times per second, repaint a clock every second, or check a server every hour.

Java 2 added another class by the same name, but in the java.util package, java.util.Timer, which is better for large timing tasks. It also has more features (eg, it can start at a given time, use either a fixed delay or fixed rate), but javax.swing.Timer is easier to use for simple animations. It is also advisable to use java.util.Timer for headless programs, those without a GUI. To prevent ambiguous references, always write the fully qualified name.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/other/10time/20timer.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
javax.swing.Timer

View Tutorial:
javax.swing.Timer

Related Tutorials:

Programming Java threads in the real world, Part 5 - JavaWorld - February 1999
Programming Java threads in the real world, Part 5 - JavaWorld - February 1999
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.