Class timer


public class timer
extends Thread

Field Summary

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

Constructor Summary

timer(JLabel myLabel, draw2 d)
Constructor for Timer

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
run()
writes the current time since start on the specified label

Field Details

begin

(package private)  long begin

d

(package private)  draw2 d

df

(package private)  DecimalFormat df

end

(package private)  long end

myLabel

(package private)  JLabel myLabel

set

(package private)  boolean set

state

(package private)  boolean state

t

(package private)  String t

Constructor Details

timer

public timer(JLabel myLabel,
             draw2 d)
Constructor for Timer
Parameters:
myLabel - the label to display time
d - the reference of a draw object

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

run

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