我找不到此界面或与此有关的其他信息:

    ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
      System.out.println("Your name is " + text.getText());
      shell.close();
      }
      });



这个接口是否命名为SelectionListener?((i.1)-为什么不能在网络上找到它?因为它不是通用的?)
这个selectionAapter是我用匿名类实现的*抽象类*?
为什么比处理程序外部类更喜欢此适配器?


非常感谢!

最佳答案

SelectionAdapter是实现SelectionListener接口的抽象类。

它实现了该接口中定义的所有方法。如果您只需要其中一些特定的代码,则可以使用它,否则直接实现该接口就很简单。

10-07 13:52