我创建PopupPanel
并展示了它.我想在一分钟过后隐藏它.在那一分钟内,不应该停止或暂停该过程.我怎样才能实现这种行为?
GWT有自己的实现Timer
.
这是一个非常小的例子:
public void onModuleLoad() {
final PopupPanel popUp = new PopupPanel();
Label text = new Label("gone in a sec");
popUp.setWidget(text);
Timer timer = new Timer() {
@Override
public void run() {
popUp.hide();
}
};
popUp.center();
timer.schedule(3000);
}
Run Code Online (Sandbox Code Playgroud)