ورود

View Full Version : سوال: فراخوانی یک تابع در ActionPerformed



lmaghsoodi
یک شنبه 17 آذر 1392, 12:11 عصر
در صورتیکه بخواهم یک تابع را در در ActionPerformed صدا بزنم، بایستی چه کاری انجام دهم ؟

cups_of_java
یک شنبه 17 آذر 1392, 13:42 عصر
JButton button;//a button I obtained from somewhere and in
// which I am interested
button.addActionListener( new ActionListener(){
public void actionPerformed( ActionEvent actionEvent ){
//do something with the fact that the button has been pressed
}
});