I realized that I probably need a background process to run the Dialog box
in. So I am trying to use the SwingWorker class like this:

final SwingWorker worker =
        new SwingWorker() {
          public Object construct()
      {
            if(waitDialog == null)
            {
              waitDialog = new MyDialog("Running the process...");
            }
            waitDialog.setLocationRelativeTo(infoTextField);
            waitDialog.show();
            return waitDialog;
        }
      };
worker.start();

// start another heavy process
anotherProcess();
......

But my dialog box's is still displayed correctly only after the process has
ended. What am I doing wrong? Any suggestions?

Thanks.



-----Original Message-----
From: Farwell, Paul [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 9:47 PM
To: Reinstein, Lenny; ''[EMAIL PROTECTED]' '
Subject: RE: Dialog box issue.


Are you calling dialog.show() on the same thread of execution used by your
'process'? Are you using SwingWorker (or some equivalent threading
technique) to run the background process? 

-----Original Message-----
From: Reinstein, Lenny
To: '[EMAIL PROTECTED]'
Sent: 12/19/01 9:38 PM
Subject: Dialog box issue.

I want to pop up a dialog box indicating to the user that they have to
wait
till a particular process finishes. When the process finishes, I close
the
dialog box. However, the dialog box pops up empty. The process starts
right
after I call dialog.show() and the dialog is correctly displayed only
when
the process finishes (too late, obviously). Any idea why this happens?
All
this dialog box has is a label with a text.

This is not a modal dialog box. It's supposed to be shown while the
process
is executing.

Thanks!

-Lenny, NY, USA. 
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to