G
Guest
I've got a method that copies files from one place to another. Each time the
file copies over it takes roughly 10 seconds per file (depending on how
large the file is).
In the meantime, I need my JPanel label to update with the current number of
files copied over so far.
I know from looking at the FAQs for this newsgroup that the GUI isn't
updating because it probably needs a new thread, but as a complete newbie to
threads, I'm wondering if I really need to learn about Threads to get my
relatively simple job done. My code simply runs in a for loop -
int count=0;
for (int i=0; i < 12; i++) {
mycopyOverFileMethod();
count++;
label.setText("Files Copied:" + count);
// Why is there no simple way in java just to put here something like :
// label.redraw();
// that avoids the need for threads??
}
Is there something simple I could do?
TIA
file copies over it takes roughly 10 seconds per file (depending on how
large the file is).
In the meantime, I need my JPanel label to update with the current number of
files copied over so far.
I know from looking at the FAQs for this newsgroup that the GUI isn't
updating because it probably needs a new thread, but as a complete newbie to
threads, I'm wondering if I really need to learn about Threads to get my
relatively simple job done. My code simply runs in a for loop -
int count=0;
for (int i=0; i < 12; i++) {
mycopyOverFileMethod();
count++;
label.setText("Files Copied:" + count);
// Why is there no simple way in java just to put here something like :
// label.redraw();
// that avoids the need for threads??
}
Is there something simple I could do?
TIA