Countdown

V

vasilis

Hi all

I have created a java applet that demonstrates an online test. However
I don’t know how I can add a countdown timer that will end the
test in 40 minutes. Could you please give me some guidelines or a link
to a source because I’m a beginner and it seems very difficult
till now. I don’t want a counter that will use images to display
the digits. It will be ok if I can display it simply in a jtextfield
area.


thanks
 
A

Andrew Thompson

I have created a java applet that demonstrates an online test. However
I don’t know how I can add a countdown timer that will end the
test in 40 minutes.

...Could you please give me some guidelines or a link
to a source because I’m a beginner and it seems very difficult
till now.

It sounds you need a different group
for the moment..
<http://www.physci.org/codes/javafaq.jsp#cljh>
 
N

Nick Pomfret

You could try a timer task:

int fourtyMins = 1000 * 60 * 40;

Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
//insert your code here - but beware your running in a
different thread now
System.out.println("times up!");
}
}, fourtyMins);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top