title: JAVA 6x6 grid colouring game
body: <p>Hi everyone Im on to the last part now which is file reading. i have tried writing a fileReader but seem to not be changing the value of my variable rNum?</p>
  
  <p>any ideas on why it wont change in the following statements? thanks</p>
  
  <pre><code>  public void readStartFile(String fileName){
      int rowNumber=-1;
      int colNumber = -1;
      int rN= 0;
      int cN = 0;
      try{
          // Open the file that is the first 
          // command line parameter
          FileInputStream fstream = new FileInputStream("start.txt");
          BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)   {
              String[] temp = strLine.split(" ");
               rowNumber = Integer.parseInt(temp[0].substring(1, temp[0].length()));
               colNumber = Integer.parseInt(temp[1].substring(1, temp[1].length()));
               String colour = temp[2];
              if(rowNumber == 0)
                  rN =0;
              else if(rowNumber == 1)
                  rN =1;
              else if(rowNumber == 2)
                  rN =2;
              else if(rowNumber == 3)
                  rN =3;
              else if(rowNumber == 4)
                  rN =4;
              else if(rowNumber == 5)
                  rN =5;
  
               if(colNumber == 0)
                  cN =0;
              else if(colNumber == 1)
                  cN =1;
              else if(colNumber == 2)
                  cN =2;
              else if(colNumber == 3)
                  cN =3;
              else if(colNumber == 4)
                  cN =4;
              else if(colNumber == 5)
                  cN =5;
              if (colour == "Red")
                  buttons[rN][cN].setBackground(Color.RED);
              System.out.println(""+rN);
              System.out.println(""+cN);
  
              }
          //Close the input stream
          in.close();
      }catch (Exception e){//Catch exception if any
          System.err.println("Error: " + e.getMessage());
      }
  }
  </code></pre>
  
  <p>this is a method from the ButtonColours class. Now how would i set the buttons to the specified colour as  what i am doing at the minute does not seem to work.</p>