Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在 GWT Push Button 上触发 click 监听器,但只有当我点击按钮文本而不是按钮时才会触发监听器。
ClickListener已弃用。改为使用addClickHandler(ClickHandler)。
ClickListener
addClickHandler(ClickHandler)
这段代码对我有用:
PushButton b = new PushButton("Up text", "Down text"); b.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { System.out.println("clicked"); } });