GWT Timer cancel not working
I am trying to write a code to differentiate between simgle and double clicks using GWT and GWTQuery. I got the idea here . So I translated it into GWT like this: (my app can't have global variables, so I am doing that part with element attributes instead): $("img").live("click", new Function() { public boolean f(Event event) { String clicksString = $(event).attr("clicks"); int clicks = Integer.parseInt(clicksString); clicks++; $(event).attr("clicks",String.valueOf(clicks)); Timer t = new Timer() { @Override public void run() { Window.alert("Click"); $(event).attr("clicks","0"); } }; if