ActionListener and Timer
Hello,
please help me. I have a problem with a timer and the actionlistener. here is my code:
public String button2_action() {
ActionListener listener = new ActionListener(){
int count = 1;
public void actionPerformed(ActionEvent e){
count++;
String zwischena = String.valueOf(count);
zeitausgabe.setValue(zwischena);
if (count == 6){ //30 Sekunden
count = 0;
//bn_v_fzg_shDataProvider.refresh();
zeitausgabe.setValue("Timer abgelaufen");
//form1.discardSubmittedValues("save");
test(count);
Option[] clear = new Option[0];
getSessionBean1().setListOptions(clear);
timer.stop();
}
}
};
timer = new Timer(1000, listener);
timer.start();
return null;
}
The function actionPerformed does not set the new object variable in the sessoinbean. can someone help me?

