java - Show Progress Dialog while swingworker process running -


i have developed simple swing application in running process using swingworker , showing indeterminate progress bar end user while process running.

as process complete setting visibility of progressdialog false in done() method of swingworker.

now problem when end user clicks on parent window getting focused , progress dialog going main window don't want when tried set modality of dialog true holding program there , swingworker thread doesn't start @ all.

as new swing let me know how can achieve both things together.

my swingworker should stop user should not able click on main happened when set modality tru dialog.

code snippet :

progressdialog myprogressdialog = new progressdialog(); myprogressdialog.setvisible(true); myprogressdialog.setlocationrelativeto(this);  myswingworkerforupdate = new swingworker<string, string>() {   @override  protected string doinbackground() throws exception {                //my code here  }    @override   protected void done() {       super.done();        myswingworkerforupdate = null;       myprogressdialog,setvisibility(false);   } };   myswingworkerforupdate.execute(); 


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -