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: 376
Skill Endorsements: 17
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: 376
Skill Endorsements: 17