//匿名内部类写法
Button btChnagText = new Button(shell, SWT.NONE);
btChnagText.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
tAa.setText("new text");
MessageDialog.openInformation(null, "", "hello");
}
});
//命名内部类写法
一、
btChnagText.addSelectionListener(new MyClick());
二、
private static final class MyClick extends SelectionAdapter{
public void widgetSelected(SelectionEvent e){
tAa.setText("第二次改写,外部函数");
}
}