• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error with Timer.start();

 
Gab Roc
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm following a tutorial on how to create a maze game, and I'm having a strange problem.
Here's my 2 classes; Maze and Board:

Maze


Board


I get an error at and .
What's wrong? Please, help me!

Thanks a lot!
 
Roel De Nijs
Sheriff
Posts: 10763
147
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you have such errors, the first thing I would do is consulting the javadoc of the appropriate class(es). So in your case that's java.util.Timer.
 
Gab Roc
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did, and still, I can't find what's the problem. And what is weird, is that the guy who is doing the tutorial don't get an error.
 
Roel De Nijs
Sheriff
Posts: 10763
147
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gab Roc wrote:I did, and still, I can't find what's the problem.

You did and you can't find the problem? So in your version of the javadoc of class java.util.Timer you'll see a constructor which takes an int and a JPanel (or ActionListener). And your version also has a start method. That's very strange.

My version of the javadoc just lists these constructors for class java.util.Timer:
Timer()
Timer(boolean isDaemon)
Timer(String name)
Timer(String name, boolean isDaemon)


So no constructor at all with an int and a JPanel as parameters. Also no start method listed in the method summary.
 
Gab Roc
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Weird. Look, here's the video: https://www.youtube.com/watch?v=64V8CC7nSok&list=PLA408D88D0EEE954D&index=2

Maybe it's not a problem with me, but with the Youtuber who posted the video. The thing is, nobody seemed to have my problem. :/
 
Roel De Nijs
Sheriff
Posts: 10763
147
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see your problem at 1st glance... And I definitely can understand why nobody has your problem.

Here's a tip: pause the video at 5:40 and closely look to the code on the video and compare with your own code. You probably will experience an aha! moment
 
Gab Roc
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hahahahahahahahaha! I can't stop laughing xD It imported the wrong «Timer» x))

Wow, it's a chance you were there. Thanks a lot! I'll mark it as Answered ASAP.

Thanks a lot!
 
Roel De Nijs
Sheriff
Posts: 10763
147
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes the silliest mistakes are the funniest ones It becomes less funny if you would have spent 2-3 hours investigating why it doesn't compile. Then the feeling is more like times 5

Glad I could help!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!