Checkerboard compile error

Hi, I'm making a checkerboard but I'm getting a few compiler errors and I'm not sure what the exact problem is.
It's saying that I have "illegal start of expression" at the line below Case 2: and that it's "expecting ')'" at line 38 which is "box[i][j] = new CBox(x+100, y, w, h, Color.black); "

Code for the class is:

//********************************************************************
//  CBPanel.java       Author: Romeo Theriault
//
//  Demonstrates the use of graphical objects.
//********************************************************************

import javax.swing.*;
import java.awt.*;
import java.util.Random;

public class CBPanel extends JPanel
{
   private CBox[][] box = new CBox[8][8];
      final int w = 100, h = 100;
      int x = -100, y = 0;
      int count = 1;
      //-----------------------------------------------------------------
   //  Constructor: Creates five Circle objects.
   //-----------------------------------------------------------------
   public CBPanel()
   {
        
              for (int i = 0; i < 8; i++){
                  for (int j = 0; j < 8; j++){
                  
                  switch (count)
                  {
                     case 1:
                       if (j % 2 == 0 && i % 2 == 0)
                                box[i][j] = new CBox(x+100, y, w, h, Color.black);
                          else
                              box[i][j] = new CBox(x+100, y, w, h, Color.red);
                              
                              break;

                     case 2:
                       if (j % 2 == 0 && i % 2 !== 0)
                                box[i][j] = new CBox(x+100, y, w, h, Color.red);
                          else
                              box[i][j] = new CBox(x+100, y, w, h, Color.black);
                              
                              break; ;
                  }      
                  
                  }            
            if (count == 2)
                        count = 1;
                  else
                        count = 2;
            x = -100;
            y = y + 100;
            }  
             
            setPreferredSize (new Dimension(800, 800));
   }

   //-----------------------------------------------------------------
   //  Draws this panel by requesting that each circle draw itself.
   //-----------------------------------------------------------------
   public void paintComponent (Graphics page)
   {
      super.paintComponent(page);
            
            for (int a=0; a < 8; a++){
                  for (int b=0; b < 8; b++)
                        box[a][b].paint(page);
                  }
            
            
            

     
   }
}
romeotheriaultAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
>                    if (j % 2 == 0 && i % 2 !== 0)

should be:

                   if (j % 2 == 0 && i % 2 != 0)
0
romeotheriaultAuthor Commented:
Thanks objects, That worked, now that it compiles it only shows the left column? I'm not sure what I've coded wrong.
0
objectsCommented:
all your boxes have the same xcoord (x=0)
you need to increment x, by 100 inside you j loop
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.