Hello I would like to implement multiple swing timers, each of which have a different function, but I cannot seem to separate the functions. I have one actionlistener and I cannot make another one. Please help.
sirlink99 56 Practically a Master Poster
Recommended Answers
Jump to Post@ sirlink99 wrote
I would like to implement multiple swing timers
yes good idea, is possible
each of which have a different function
yes good idea, probably safer way
but I cannot seem to separate the functions. I have one actionlistener …
Jump to PostTimer timer_1, timer_2; timer_1 = new Timer(new TimerAction1()); timer_2 = new Timer(new TimerAction2()); //the 2 timers call different methods //define the 2 methods class TimerAction1 implements ActionListener { public void actionPerformed(ActionEvent e) { //whatever you want the first timer to do } } class TimerAction2 implements ActionListener …
All 7 Replies
mKorbel 274 Veteran Poster
sirlink99 56 Practically a Master Poster
mKorbel 274 Veteran Poster
mKorbel 274 Veteran Poster
sirlink99 56 Practically a Master Poster
Mattox 0 Junior Poster in Training
mKorbel 274 Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.