This week's book giveaway is in the Open Source Projects forum. We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line! See this thread for details.
Am making an application that downloads updates from the Internet. It should update a JProgressBar appropriately as the download proceeds. There is the point of interest:
Here this is the output:
Please, but why is it stuck at 0% then jump t0 100% yet the gradual progress is clear? Why doesn't it update?
Suppose totalInInt is 100 and downloadedInInt is 12. Now 12/100 = 0.12 but as you are using ints this will be rounded to 0. You then multiply this by 100 and get 0. This will be the result until downloadedInInt and totalInInt are equal when the division will give you 1 as a result.
Do the multiplication first and it should work