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.
我试图弄清楚将 MouseDownHandler 与 ListBox 一起使用。
我有以下代码:
myCombo.addMouseDownHandler(new MouseDownHandler(){ Window.alert("WORKING"); });
但是,我收到此错误。
FocusWidget 类型中的方法 addMouseDownHandler(MouseDownHandler) 不适用于参数 (new MouseDownHandler(){})
MouseDownHandler必须实现该方法onMouseDown:
MouseDownHandler
onMouseDown
myCombo.addMouseDownHandler(new MouseDownHandler() { @Override public void onMouseDown(MouseDownEvent event) { // Handle mouse down event } });