I’m creating a program in SWT. I have a first Shell that has on it the “add user” button.
When you click on the button, a second shell appear.
In this case the first shell is still cliccable and focusable. I cannot understand how to avoid that the first shell is focusable until the second has been closed.
This behavior is the default behavior of the dialogs, but I want to have the same behavior with shells. Do you know how can I obtain that?
The code I use to open the second shell is this:
Display display = Menu.this.getDisplay();
AddEditUser shell = new AddEditUser(display);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
Thankyou
I follow your suggestions, and now the behavior is ok, but now the second shell does not have the top bar as shown in the picture.

Use
SWT.SYSTEM_MODALorSWT.APPLICATION_MODALfor second shells style