0

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(){})

casperOne
  • 73,706
  • 19
  • 184
  • 253
james
  • 2,595
  • 9
  • 43
  • 70

1 Answers1

2

The MouseDownHandler has to implement the onMouseDown method:

myCombo.addMouseDownHandler(new MouseDownHandler() {
  @Override
  public void onMouseDown(MouseDownEvent event) {
    // Handle mouse down event
  }
});
Jason Terk
  • 6,005
  • 1
  • 27
  • 31