posted 18 years ago
Hello,
I've written a program that is transferring records from one database to another. I have a main class, a GUI builder class, and a seperate class for each table I transfer. So, the main class sets stuff up, calling the GUI class, and the GUI class then calls upon each table class to handle the transfers (You select tables to transfer with checkboxes, and hit a button to begin).
I have two JProgressBars, one that shows the progress on the current table, and one that shows total progress. So, if I want to transfer two tables (each with 1000 records) then the top bar goes to 1000, and then resets when the second table is started, while the bottom bar will go all the way to 2000.
I set the maximum values for the bars in the GUI class, and have a static method for updating the values, which is then called per record in each respective table class.
I hope this has made sense thus far...
The problem is, when I run the program, the GUI window seems to lose focus while the queries and updates run, and so the ProgressBars don't repaint. These are no small tasks, each table transferred takes a number of minutes to complete, so I'd like the user to be able to see where he stands.
Am I overlooking something obvious?
Thanks in advance.