I am reading a file using bufferedREader ,the file is a text file with lot of text
here is how I am reading it
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;
}
}
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:
while(true)
{
try
{
br.readLine();
progressBar.setValue(percentageRead);//how do I get percentageRead value dynamically?
}
catch(IOException e)
{
break;
}
catch (Exception e)
{
break;
}
}