Because the class "Timer" constructor prototype doesn't have the type you are declaring. Where is your Timer class? And what are its constructors?
// do you have this type of constructor in your Timer class?
public Timer(int anInt, Morning aMonringObj) {
...
}
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17
The second parameter to the Timer constructor you're using needs to implement ActionListener . JFrame doesn't implement it, so you'll have to do that in your Morning class yourself.
Also: You'll get better results posting questions like this in the Java forum.
gusano79
Practically a Master Poster
676 posts since May 2004
Reputation Points: 193
Solved Threads: 108
Skill Endorsements: 6
Which Timer class do you really want to use? Is it from javax.swing.Timer, java.util.Timer, or your own customized class? You may need to look at the classes' constructor. They are different.
By the way, implementing only ActionListener() inside the Morning class won't solve the whole problem if you still pass in the "Morning" class to the Timer as it is now.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17