Re: add timer on panel......

2012-06-04 Thread Ben Klein
If I recall correctly, System.currentTimeMillis() still works in GWT. In 
your timer code, this can be called; end_time + start_time - current_time 
will give you how much time is left.

On Tuesday, May 29, 2012 7:59:43 AM UTC-4, Harshal Patil wrote:

 Hello

 Can anyone plz help me to create timer and how to add it on the panel?


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/eCENtNNtlvwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: add timer on panel......

2012-06-01 Thread Joseph Lust
Harshal,

You will need to write a simple stopwatch state machine. You can wrap it up 
as a simple widget to display the time. Basically you just need to track 
the current time and decrement it every second.

This has been discussed before on StackOverflow 
herehttp://stackoverflow.com/questions/6725365/countdown-clock-in-gwt. 
See the use the GWT Timer in the bottom answer. You'll also want to have 
some functions to convert seconds to formatted time to display it in your 
widget. You could use some GWT formatters on the Date object, or just write 
your own functions since the math is simple.

You'll want to check on the start time/ elapsed time on the server side too 
since a mildly talented use could hack the browser side timer. The possible 
trouble point here is that there is no guarantee that your timer and the 
serverside will match, since JS could lose time if there was contention for 
the browser thread, and neither side is an RTC. The last thing you'd want 
is for someone to finish in time, but get rejected by the server when 
submitted because they were overtime.

Sincerely,
Joseph



On Thursday, May 31, 2012 6:56:21 AM UTC-4, Harshal Patil wrote:

 Hi Joseph,

 I am creating online exam portal.

 In that i have to specify some time e.g 1 hour to end the exam.

 also it will automatically decrements the time in the 1 second of interval 
 i.e. 1:00 hr, 00:59 hr, 00:57-00:00 
 hr.

 so it will automatically ends the exam after 1 hour of interval. 

 I have to show that decrementing timer on the panel. 


 On Thursday, May 31, 2012 1:43:54 AM UTC+5:30, Joseph Lust wrote:

 Harshal,

 Why do you need to add the timer to a panel? What do you want the timer 
 to do? It is not clear from your question.

 Timer timer = new Timer();



 Sincerely,
 Joseph



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/DqHWr5rW--YJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: add timer on panel......

2012-05-31 Thread Harshal Patil
Hi Joseph,

I am creating online exam portal.

In that i have to specify some time e.g 1 hour to end the exam.

also it will automatically decrements the time in the 1 second of interval 
i.e. 1:00 hr, 00:59 hr, 00:57-00:00 
hr.

so it will automatically ends the exam after 1 hour of interval. 

I have to show that decrementing timer on the panel. 


On Thursday, May 31, 2012 1:43:54 AM UTC+5:30, Joseph Lust wrote:

 Harshal,

 Why do you need to add the timer to a panel? What do you want the timer to 
 do? It is not clear from your question.

 Timer timer = new Timer();



 Sincerely,
 Joseph


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/2IQZcthRwRcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



add timer on panel......

2012-05-30 Thread Harshal Patil
Hello

Can anyone plz help me to create timer and how to add it on the panel?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3D-fqY8mtZAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: add timer on panel......

2012-05-30 Thread Joseph Lust
Harshal,

Why do you need to add the timer to a panel? What do you want the timer to 
do? It is not clear from your question.

Timer timer = new Timer();



Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/SD9R1j5efJwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.