title: Error When Parsing sLine String into Integer
body: <p>This code is just a file reader, and it does not show any errors, however when i go to run it, an error seems to occur on this line: int temp2 = Integer.parseInt(temp[x]);</p>
  
  <p>Why is it seemingly unable to parse this variable into an integer?</p>
  
  <pre><code>public void loadRecordTimes(){
  
      //get each time from the text file
      try{
          File f = new File ("Times.txt"); 
          //appends content to file
          FileReader fr = new FileReader(f);
          //bufferedwriter writer give better performance
          BufferedReader br = new BufferedReader(fr);
  
          //reads a line from the text file
          String sLine = br.readLine();
  
          //as long as something was read from the file, it will keep running
          while (sLine != null){               
              //take the line that was read and split it based on on the comma
              String[] temp = sLine.split(",");
  
              for (int x = 0; sLine != null; x++){        
  
              System.out.println(temp[x]);
  
              int temp2 = Integer.parseInt(temp[x]);
              //adds recorded times from content file to array
              recordTimes.add(temp2);
  
              }
  
              sLine = br.readLine();     
          }
  
      br.close();
      fr.close();
  
      }
  
      catch(IOException e){
  
      System.out.println("Exception occured:");
      e.printStackTrace();
  
      }    
  
  } 
  </code></pre>
  
  <p>This is the error message that my IDE has given me if this helps:    </p>
  
  <pre><code>at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
          at java.lang.Integer.parseInt(Integer.java:580)
          at java.lang.Integer.parseInt(Integer.java:615)
          at GlobeTrotter.loadRecordTimes(GlobeTrotter.java:912)
          at GlobeTrotter.&lt;init&gt;(GlobeTrotter.java:54)
          at GlobeTrotter$22.run(GlobeTrotter.java:1460)
          at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
          at java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.awt.EventQueue$3.run(EventQueue.java:709)
          at java.awt.EventQueue$3.run(EventQueue.java:703)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
          at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
          at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
          at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  </code></pre>