title: Calling a method to read from a text file with BufferedReader
body: <p>I searched around for this but I could not find a soultion.</p>
  
  <p>Sorry about my bad description. Im not very good at this.</p>
  
  <p>I have a UI class
  Its calling a "lotto" class.</p>
  
  <p>That lotto classes constructor is called a method named readData()
  readData is reading from a file using BufferedReader</p>
  
  <p>Im not getting an error message but its just not reading.
  It gets stuck at BufferedReader fr = new BufferedReader... and goes to the catch thing.</p>
  
  <p>If its a file not found problem how would i make it track where my file is. Im using eclipse and the program is stored on my usb. I need to hand it in to my teacher so i cant just put a location in. Is there code that tracks where my program is then takes the file from that folder?</p>
  
  <p>Here is the code being used.</p>
  
  <p>import java.io.*;</p>
  
  <pre><code>//contructor
  
  public Lotto()
  {
      try
      {
          readData();
          nc = new NumberChecker();
      }
      catch(IOException e)
      {
          System.out.println("There was a problem");
      }
  }
  
  private void readData() throws IOException
  {
      //this method reads winning tickets date and pot from a file
  
      BufferedReader file = new BufferedReader (new FileReader("data.txt"));
  
  
      for(int i=0;i&lt;5;i++)
      {
          System.out.println("in "+i);
          winningNums[i] = file.readLine();
          winningDates[i] = file.readLine();
          weeksMoney[i] = Integer.parseInt(file.readLine());
          System.out.println("out "+i);
      }
  
      file.close();
  
  }
  </code></pre>