JProgressBar question
I placed a progress bar on my form and it works almost fine.
But the application.updateUI() slows everything down, It doesn’t makes any sense to add a this Progress bar.
Dose somebody have a suggestion, how I can speed this up?
Regards
ttmgybta
Hi,
I guess you are you calling application.updateUI() in a loop and do that for every iteration.
You better call the updateUI() at a larger interval (depending on your needs). You can do this by using the following code:
// start of loop
// only update every 50 iterations
// adjust accordingly to your own needs.
if ( iterationNr%50 == 0 ) {
application.updateUI();
}
// end loop
Hope this helps.
Thank you, Robert.
It is much faster now.
My next problem is that I want to set the maximum value from a Foundset whit.
elements.bar_progress.setMaximum(foundset.getSize())
But it just sets the first 200 which are loaded in the foundset, how do I get the real size of the foundset?
Regards
ttmgybta
Use the getFoundSetCount() function in the databaseManager:
var _nMax = databaseManager.getFoundSetCount(foundset)