I am doing a program using Timer class. I start the Timer in a function.
When the function is called directly in the program, it works fine.( The Timer can send ActionEvent every delay time, and call ActionPerformed function to do the job.)
But when I put the function in an ActionPerformed function of another ActionListener added on a MenuItem, after that MenuItem is clicked, the Timer's ActionListener wont get any event anymore. Furthermore, other items listening an ActionEvent cant get event as well.(The program doesnt go into ActionPerformed function)
Does anyone know what is wrong with it?
When the function is called directly in the program, it works fine.( The Timer can send ActionEvent every delay time, and call ActionPerformed function to do the job.)
But when I put the function in an ActionPerformed function of another ActionListener added on a MenuItem, after that MenuItem is clicked, the Timer's ActionListener wont get any event anymore. Furthermore, other items listening an ActionEvent cant get event as well.(The program doesnt go into ActionPerformed function)
Does anyone know what is wrong with it?