Class timer


public class timer
extends Thread

Field Summary

(package private) long
begin
(package private) DecimalFormat
df
(package private) long
end
(package private) long
hold
(package private) JLabel
myLabel
(package private) long
pausetime
(package private) boolean
set
(package private) boolean
state
(package private) String
t

Constructor Summary

timer()
timer(JLabel myLabel)
Constructor for TheTimer

Method Summary

long
getTime()
gives back the time in milliseconds
void
go()
starts the timer
void
hold()
stop the timer
void
reset()
resets the timer
void
restart()
void
run()
writes the current time since start on the specified label

Field Details

begin

(package private)  long begin

df

(package private)  DecimalFormat df

end

(package private)  long end

hold

(package private)  long hold

myLabel

(package private)  JLabel myLabel

pausetime

(package private)  long pausetime

set

(package private)  boolean set

state

(package private)  boolean state

t

(package private)  String t

Constructor Details

timer

public timer()

timer

public timer(JLabel myLabel)
Constructor for TheTimer
Parameters:
myLabel - the label to display time

Method Details

getTime

public long getTime()
gives back the time in milliseconds
Returns:
long the time in milliseconds

go

public void go()
starts the timer

hold

public void hold()
stop the timer

reset

public void reset()
resets the timer

restart

public void restart()

run

public void run()
writes the current time since start on the specified label
See Also:
java.lang.Runnable.run()