【正文】
class ButtonSelectionListener extends SelectionAdapter{ public void widgetSelected(SelectionEvent e){ } } 實現(xiàn)監(jiān)聽接口法 Public class HelloWorld extends SelectionAdapter{//或implements SelectionListener Public static void main(String[] args){ (new HelloWorld())。 命名內(nèi)部類寫法從代碼書寫、閱讀、維護以及程序的可擴展性角度來看值得推薦