• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checkerboard.java using a component Array and Counter-Controlled Loop

 
Joniela Geldenhuys
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Helo I've just finished coding my one assignment. When I compile they give me an error.

java:88: ')' expected

When I put a ) in they just give me more errors!

Please help

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the Spring forum for Spring Framework questions. I am going to move this to the Beginning Java forum.

I think the main issue is how your curly braces are lined up. I can't tell how things are lined up based on your indentation of code.

I copied your code into my ide and auto-indented and found


There is a semicolon after the curly brace, it should actually be after the curly brace just above it to end the addActionListener() call.

After those lines you have two methods which are not inside your class. The second curly brace I just showed is ending your class, then you have the two methods. You need to move those two methods to before that }//end Checkerboard frame to get the methods to be inside your class.

You always need to make sure curly braces are correctly lined up

Mark
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No offense, but you should never have gotten this far. Never, never never write more than 2-3 lines of code before you recompile. I have been know to recompile after writing a single line. Really you should recompile and TEST that often, but I do occasionally skip the testing part. but NEVER the compile.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
== "Go"??

Never use == to test whether reference types are equal, except members of enums. And search our GUIs forum to find why addActionListener(this) is non-object-oriented design.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic