src/share/classes/javax/swing/Timer.java

Print this page




 104  * provide the same basic functionality,
 105  * but <code>java.util.Timer</code>
 106  * is more general and has more features.
 107  * The <code>javax.swing.Timer</code> has two features
 108  * that can make it a little easier to use with GUIs.
 109  * First, its event handling metaphor is familiar to GUI programmers
 110  * and can make dealing with the event-dispatching thread
 111  * a bit simpler.
 112  * Second, its
 113  * automatic thread sharing means that you don't have to
 114  * take special steps to avoid spawning
 115  * too many threads.
 116  * Instead, your timer uses the same thread
 117  * used to make cursors blink,
 118  * tool tips appear,
 119  * and so on.
 120  *
 121  * <p>
 122  * You can find further documentation
 123  * and several examples of using timers by visiting
 124  * <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html"
 125  * target = "_top">How to Use Timers</a>,
 126  * a section in <em>The Java Tutorial.</em>
 127  * For more examples and help in choosing between
 128  * this <code>Timer</code> class and
 129  * <code>java.util.Timer</code>,
 130  * see
 131  * <a href="http://java.sun.com/products/jfc/tsc/articles/timer/"
 132  * target="_top">Using Timers in Swing Applications</a>,
 133  * an article in <em>The Swing Connection.</em>
 134  * <p>
 135  * <strong>Warning:</strong>
 136  * Serialized objects of this class will not be compatible with
 137  * future Swing releases. The current serialization support is
 138  * appropriate for short term storage or RMI between applications running
 139  * the same version of Swing.  As of 1.4, support for long term storage
 140  * of all JavaBeans<sup><font size="-2">TM</font></sup>
 141  * has been added to the <code>java.beans</code> package.
 142  * Please see {@link java.beans.XMLEncoder}.
 143  *
 144  * @see java.util.Timer <code>java.util.Timer</code>




 104  * provide the same basic functionality,
 105  * but <code>java.util.Timer</code>
 106  * is more general and has more features.
 107  * The <code>javax.swing.Timer</code> has two features
 108  * that can make it a little easier to use with GUIs.
 109  * First, its event handling metaphor is familiar to GUI programmers
 110  * and can make dealing with the event-dispatching thread
 111  * a bit simpler.
 112  * Second, its
 113  * automatic thread sharing means that you don't have to
 114  * take special steps to avoid spawning
 115  * too many threads.
 116  * Instead, your timer uses the same thread
 117  * used to make cursors blink,
 118  * tool tips appear,
 119  * and so on.
 120  *
 121  * <p>
 122  * You can find further documentation
 123  * and several examples of using timers by visiting
 124  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html"
 125  * target = "_top">How to Use Timers</a>,
 126  * a section in <em>The Java Tutorial.</em>
 127  * For more examples and help in choosing between
 128  * this <code>Timer</code> class and
 129  * <code>java.util.Timer</code>,
 130  * see
 131  * <a href="http://java.sun.com/products/jfc/tsc/articles/timer/"
 132  * target="_top">Using Timers in Swing Applications</a>,
 133  * an article in <em>The Swing Connection.</em>
 134  * <p>
 135  * <strong>Warning:</strong>
 136  * Serialized objects of this class will not be compatible with
 137  * future Swing releases. The current serialization support is
 138  * appropriate for short term storage or RMI between applications running
 139  * the same version of Swing.  As of 1.4, support for long term storage
 140  * of all JavaBeans<sup><font size="-2">TM</font></sup>
 141  * has been added to the <code>java.beans</code> package.
 142  * Please see {@link java.beans.XMLEncoder}.
 143  *
 144  * @see java.util.Timer <code>java.util.Timer</code>