>>         So I tried
>>
>>         msg.setText( string );
>>         msg.paintImmediately( msg.getBounds() );
>>
>>         It paints, but it doesn't paint the entire component.
>>         Specifically, it doesn't paint part of the left side.
>>
>>         Shouldn't this work?

>It should, but...  In either case, running a long operation inside the GUI
>thread is not a good idea at all and I would strongly urge against
>it.  Move your task to a worker thread and if you want to force the user to
>wait until the task is finished, there better ways of going about it like
>disabling the entry fields and/or putting up a modal progress bar.

Thanks Dmitry. But that's why I pointed out that "long" in this case is
actually about 3 seconds. And if I can update the TextField during the
4 stages that occur in the 3 seconds, the user gets feedback. A popup
progress bar is overkill in this circumstance as it would be "noisy" for
such a short operation (dialogs shouldn't come and go that quickly unless
it's a dialog that the user is already well-trained that they can ignore if
it goes away quickly, such as the Windows popup on a drag-n-drop copy -
otherwise you get the "what the heck was that" effect).

Simply an hourglass is OK for this length of time, but since the operation
has 4 stages, I thought I might as well inform the user. I certainly can
use a thread and invokeLater to update the GUI, but then I have to make sure
the user doesn't do anything else. Since I'm already in the event dispatch
thread, which is where I prefer to be, I thought paintImmediately would be
ideal, if it worked.

.... Roger
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to