【发布时间】:2012-06-13 17:46:12
【问题描述】:
有跟随课-
public class GUIclass1 extends org.eclipse.swt.widgets.Composite {
private void initGUI() {
{
// The setting of the open file button.
openButton = new Button(this, SWT.PUSH | SWT.CENTER);
openButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
foo() ;
}
});
}
}
public void foo() {
// implementation ..
}
}
正如您在 addSelectionListener 中看到的,有一个对方法 foo() 的调用。
我的问题是 - 我应该将哪个引用写为 foo() 的前缀,以便知道 foo() 与哪个类相关。
我尝试了super().foo(),但没有成功。
【问题讨论】:
标签: java button methods swt listener