[英]GWT button click event
i have one window panel in my project. 我的项目中有一个窗口面板。 and i add one button to it.
我添加一个按钮。 when i click the button,i want two event to fire.
当我单击按钮时,我希望触发两个事件。 one event is to hide that window,which i achieve through
一个事件是隐藏那个窗口,我通过
Button button = new Button("click");
button.addListener(new ButtonListenerAdapter(){
@Override
public void onClick(Button button, EventObject e) {
hide();
super.onClick(button, e);
}
});
Window.add(button);
and second i want to pop up another window at the same time on the same button click..what to do? 第二,我想在同一时间单击同时弹出另一个窗口。该怎么办? help me out
帮帮我
I think this should solve your problem : 我认为这应该可以解决您的问题:
final boolean evenClick = false;
Button button = new Button("click");
button.addListener(new ButtonListenerAdapter(){
@Override
public void onClick(Button button, EventObject e) {
if (!evenClick) {
hide();
super.onClick(button, e);
}
else {
//DO YOUR SECOND CLICK STUFF
}
evenClick = !evenClick;
}
});
Window.add(button);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.