SelectionListener and SelectionAdapter
I can't find this interface or other information about this:
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
System.out.println("Your name is " + text.getText());
shell.close();
}
});
Does this interface named
SelectionL开发者_JS百科istener
?((i.1)- why can't I find it on web? because it is not generic?)This selectionAapter is an*abstract class* which I implement with anonymous class?
Why do I prefer this adapter over a handler external class?
Thanks a lot!
SelectionAdapter is an abstract class that implements the SelectionListener interface.
It implements all the methods defined in that interface. You can use it if you only need specific code for some of them, otherwise implementing the interface directly is just as simple.
精彩评论