Yes, create the dialog and start the progress bar in the
action peformed and then update it with calls to SwingUtilities.invokeLater in
your MyRunnable class. Make sure you close the dialog in a finally
block.
public void actionPerformed(ActionEvent ae) {
startProgressDialog();
Runnable runnable = new Runnable()
{
public void run()
{
try { // do some long operation and update progress dialog in the Swing thread when appropriate }
finally {
closeProgressDialog(); // remember to do this in the swing
thread
}
}
new Thread(runnable).start();
}
Hope this helps.
Regards
Sachin
|
Title: suspend the awt thread
- suspend the awt thread Deblauwe, Wim
- Re: suspend the awt thread Sachin Hejip
- Re: suspend the awt thread Sachin Hejip
- RE: suspend the awt thread Deblauwe, Wim
- Re: suspend the awt thread Sachin Hejip
- Re: suspend the awt thread Sachin Hejip
- RE: suspend the awt thread Deblauwe, Wim
- Decent browser component? Frank D. Greco
- Re: Decent browser component? Sachin Hejip
- Re: Decent browser component? Frank D. Greco