InputStream bis = new BufferedInputStream(new ProgressMonitorInputStream(parentComponent,"Reading " + Filename, new FileInputStream(myFile)));
3 Replies - 913 Views - Last Post: 03 December 2011 - 02:36 PM
#1
Using progress bars with buffered input and output streams
Posted 03 December 2011 - 02:23 PM
I am trying to use a progress monitor to monitor the read speed of a file. i have the code i am using currently. i am unsure of what to do to make the progress bar show. any help is much appreciated
Replies To: Using progress bars with buffered input and output streams
#2
Re: Using progress bars with buffered input and output streams
Posted 03 December 2011 - 02:29 PM
Progress Bar Tutorial is a good tutorial, as well as How to use Progress Bars.
This post has been edited by exiles.prx: 03 December 2011 - 02:30 PM
#3
Re: Using progress bars with buffered input and output streams
Posted 03 December 2011 - 02:31 PM
i think i need to start a new thread to "paint" the object, but can someone explain how to do this?? thanks
#4
Re: Using progress bars with buffered input and output streams
Posted 03 December 2011 - 02:36 PM
You don't need a separate thread
The File has a size() method so you can get the size of the file in bytes
then in a loop if you read from file 1000 bytes at a time compute the percentage done and update your progress bar accordingly. It will automatically repaint itself
The File has a size() method so you can get the size of the file in bytes
then in a loop if you read from file 1000 bytes at a time compute the percentage done and update your progress bar accordingly. It will automatically repaint itself
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|