在Java中实现计时器最简单的方法是什么?

时间:2022-11-28 04:31:54

I'm building a JSF application ( assignment for college ) where people log in the site, bid and when the time expires a pop up window or an output tag announces who is the winner.

我正在构建一个JSF应用程序(为大学分配),人们登录网站,出价,当时间到期时,弹出窗口或输出标签宣布谁是赢家。

So I want to know how can I make an output tag update his value every second ( to show the user how much time he has to bid ) and when it reaches 60 seconds it calls a method to show the pop up window ( or tag ) and announce the winner.

所以我想知道如何让输出标签每秒更新一次值(向用户显示他有多少时间出价),当它达到60秒时,它会调用一个方法来显示弹出窗口(或标签)并宣布获胜者。

Thanks. Obs: ESL.

谢谢。 Obs:ESL。

2 个解决方案

#1


0  

Richfaces has got a4j:poll , which fits for you

Richfaces有一个适合你的a4j:民意调查

#2


0  

Maybe a TimerTask is what you want.

也许TimerTask就是你想要的。

#1


0  

Richfaces has got a4j:poll , which fits for you

Richfaces有一个适合你的a4j:民意调查

#2


0  

Maybe a TimerTask is what you want.

也许TimerTask就是你想要的。