posted 13 years ago
The application has a command to upload bunch of files to a server over a ssh link. So I have the transfer done in a SwingWorker class, which fires property change events. I have a property change listener in a JDialog class that is supposed to update a progress bar and some text fields like which file it's on, how many bytes have been sent, transfer rate. Basically enough fluff to keep the user entertained during the transfer.
That part works fine as a println in the property change listener shows it is receiving regular (and correct) updates.
My problem is that I can't figure out how to get the dialog to draw all the items when they are updated.
I can get the progress bar to work with:
Although it does flash a little, it's acceptable.
If I try that with a JLabel it writes the new value over the old without clearing so it's soon unreadable.
I've tried, repaint(), paint(Graphics g), update (Graphics g). Paint and repaint don't seem to do anything.
Of course once the transfer finishes the dialog is repainted with the final values just fine.
It must be a simple call I'm missing. I don't know why I seem to always get the hard part working and spend hours on the simplest things.
Any help is appreciated.
Joe
It's not what your program can do, it's what your users do with the program.