-
Problem with addSelectionListener() ...
Problem with addSelectionListener() ...
I have a problem with menuItem.addSelectionListener()
See the code below
MenuItem menuItem = new MenuItem("Open");
menuItem.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent event) {
// doing some operation
System.out.println("Open menuitem selected");
}
This code is working properly the selectionlistener is working
when i click the menuitem I get the print as
Open menuitem selected
But in the below code selectionlistener is not working
MenuItem menuItem = new MenuItem("Open");
menuItem.addSelectionListener(new MenuListener());
// And my MenuListener class is like this
class MenuListener extends SelectionListener<ComponentEvent> {
MenuListener()
}
public void componentSelected(ComponentEvent ce) {
// doing some operation
System.out.println("Open menuitem selected");
}
public void handleEvent(ComponentEvent be) {
}
}
Is this correct way to extend the selection listener class or
we cannot extend selectionlistener class
Thanks in advance
-
Ext GWT Premium Member
don't override handleEvent, or call super.handleEvent(be);
-
Thanks for the help its working now
Sam
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us