Skip to main content

Help with Dialogs (wait Dialog) - SOLVED

2 replies [Last post]
rampazzo1989
Offline
Joined: 2010-10-14

Hello everyone! I have the following issue:
I need a wait Dialog, to be shown while some proccess occurs. These proccess are inside a Thread, and the last line of it closes the Dialog (by showing the main form again). Is it right? 'cause I think: and if the proccess terminates before the Dialog be shown?
My code below:
if(evt.getCommand().equals(cOk)){

new Thread(new Runnable() {

public void run() {
lstNomes.setModel(dados.findEmpresas(tNome.getText()));
lstNomes.requestFocus();
getFPorNome().show();
}
}).start();
getDlgAguarde().show();

}

thanks by now

Message was edited by: rampazzo1989

Message was edited by: rampazzo1989

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

Try modeless dialogs which you can show before starting the thread.
You can also wait within the thread until Display.getCurrent() == myDialog.

rampazzo1989
Offline
Joined: 2010-10-14

Thanks! I solved it with modeless dialogs, like suggested. I show the Dialog calling .showModeless(), and then i call .dispose(), when the processing ends.