當按鈕被單擊時
protected void fireActionPerformed(ActionEvent event) {
Object[] listeners = listenerList
//實現的ActionListener
ActionEvent e = null;
for (int i = listeners
if (listeners[i]==ActionListener
if (e == null) {
String actionCommand = event
if(actionCommand == null) {
actionCommand = getActionCommand()
}
e = new ActionEvent(AbstractButton
ActionEvent
actionCommand
event
event
//告訴應用層是何種事件發生
}
((ActionListener)listeners[i+
//回調應用層的實現
}
}
}
返回目錄
編輯推薦
Java程序設計培訓視頻教程
J
J
Visual C++音頻/視頻技術開發與實戰
Oracle索引技術
ORACLE
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27816.html