Gwt MouseDownHandler usage

1.2k views Asked by At

I am trying to figure out to use a MouseDownHandler with a ListBox.

I have the following code:

myCombo.addMouseDownHandler(new MouseDownHandler(){
  Window.alert("WORKING");
});

I get this error however.

The method addMouseDownHandler(MouseDownHandler) in the type FocusWidget is not applicable for the arguments (new MouseDownHandler(){})

1

There are 1 answers

1
Jason Terk On BEST ANSWER

The MouseDownHandler has to implement the onMouseDown method:

myCombo.addMouseDownHandler(new MouseDownHandler() {
  @Override
  public void onMouseDown(MouseDownEvent event) {
    // Handle mouse down event
  }
});