Frage

How do I go about making a timer that will increment the time in a JFormattedTextField?

War es hilfreich?

Lösung

Look at http://download.oracle.com/javase/6/docs/api/javax/swing/Timer.html

This lets you execute an ActionListener repeatedly in the Swing event thread with a specified delay.

The just get and set the value from the textfield.

Edit: not a Runnable but an ActionListener

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top