• Post Reply Bookmark Topic Watch Topic
  • New Topic

I'm new and slow and would like some help with errors in my project thanks for your time  RSS feed

 
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new at this and some what slow, and would really like some help please. I just rewrote my program TicTacToeGUIGame, and have a few problems That I need help with.
1. In the main I receive this error...Exception in thread "main" java.lang.Error: Unresolved compilation problem: at TicTacToeGUIGame.TicTacToeGUIGame.main(TicTacToeGUIGame.java:15)
2. In the main on line 54 I receive an error... Syntac error, insert "EnumBody" to complete the block statement.
In the Cell Class I have a few errors.
1. Line 19 the error is ... Games.Board type cannot be resloved to a type.
2. Line 58 I receive the error ... The method drawLine(int, int, int, int) in the type graphicsis not applicable for the argument (int, int, int void)
Thank you for your time and effort. Danny

Main


Cell




 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't even have to look at your code. My advice: Throw it all away, and start over. Why? Because you should never write more than 2-3 lines of code before you compile. You have clearly written WAY more than that, which basically makes it impossible to figure this stuff out.

So...

turn off your computer.
turn on your brain.
get some paper, pencils, and erasers, and start thinking about how this should work.
Get it to work on a command line before you try to make a GUI.
Get one method to work before you begin writing the next.
Slow down.

Folks around here will tell you that programming is about 90% thinking, and only 10% writing lines of java (or whatever language you choose).
 
Danny Broadwater
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. ! third of this project was inherited from the previous project, the next third was given to me to add to it and the last third is to figure it out. That's why I am asking for help. Thanks for your time anyway...
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have to start with this, here's what I would suggest.

Comment out a bunch of it. Comment out as much as you can, and focus on one piece at a time. Trying to fix all these errors at once is next to impossible.

I would seriously start by commenting out everything but your main method, and then comment out the one line in it. Get that to compile.

Put in a System.out.println() line that says something like "Main method works". compile and test that. Once you KNOW that works, you can take it out, and maybe uncomment the line you do have in there. So then you'll have to uncomment some of TicTacToeGUIGames - but I'd only do enough to get the one main line to work - i.e. create an empty object that does nothing - or maybe simply prints "I created a TicTacToeGUIGames object!!!"

once that works, uncomment enough of TicTacToeGUIGames to do ONE small piece...etc.

keep doing it in the teeniest, tiniest piece that you can on each compile/test/debug iteration. I would expect you to recompile and test HUNDREDS of times in a program as big as this is.
 
Danny Broadwater
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks, now I understand what you are saying. Thanks your your effort and time. Danny
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!