title: How do I track reading of a a file using .readLine() in java?
body: <p>I am reading a file using bufferedREader ,the file is a text file with lot of text</p>
  
  <p>here is how I am reading it </p>
  
  <pre><code> while(true)  //I know the loop is not perfect just ignore it for now, i wanna concentrate on the tracking
                  {
                        try
                        {
                         br.readLine();
                        }
                        catch(IOException e)
                        {
                        break;
                        }
                        catch (Exception e)
                        {
                        break;
                        }
                  }
  </code></pre>
  
  <p>I want to track what percentage of the file I have read so I can use that percentage value in my progress bar like this:</p>
  
  <pre><code>while(true)
                  {
                        try
                        {
                         br.readLine();
                         progressBar.setValue(percentageRead);//how do I get percentageRead value dynamically?
                        }
                        catch(IOException e)
                        {
                        break;
                        }
                        catch (Exception e)
                        {
                        break;
                        }
                  }
  </code></pre>