Re: Using JProgressBar to show file upload progress



Okay, I just found the solution. Just in case anyone else out there is
having a similar problem, all I did was change the above ButtonListener
class code to this instead:

class ButtonListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
preUpload();
new Thread(new Runnable() {
public void run() {
String allText = fileListArea.getText();
StringTokenizer st = new StringTokenizer(allText,
"\n");
if (st.countTokens() > 0) {
connectToFTP();
while (st.hasMoreTokens()) {
String line = st.nextToken();
doUpload(line);
System.out.println("FILE: " + line);
}
disconnectFTP();
}
}
}).start();
postUpload();
}
}


Thanks for all your help guys. I really appreciate it!

.