更新時間:2022-05-25 10:54:25 來源:動力節點 瀏覽1443次
動作監聽器 java
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/*in main*/
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println('x');
}
});
java swing按鈕點擊
JButton b = new JButton("push me");
b.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//your actions
}
});
0基礎 0學費 15天面授
有基礎 直達就業
業余時間 高薪轉行
工作1~3年,加薪神器
工作3~5年,晉升架構
提交申請后,顧問老師會電話與您溝通安排學習