just_a_programmer
just_a_programmer

Reputation: 341

Java SWT: Disable focus to 1st window until 2nd window closed

With SWT, I have 2 windows (in this case, called win1 & win2). win1 is the primary window, and it has a button that opens win2. When I press it, win2 appears and the focus is shifted to it. I don't want the user to be able to interact with win1 until they exit out of win2. How do I go about this? Basically, I want to 'lock' win1 until win2 is closed.

Using Java 1.7 with Eclipse Kepler and WindowBuilder plugin.

Upvotes: 0

Views: 520

Answers (1)

Marko Topolnik
Marko Topolnik

Reputation: 200168

Use

win2 = new Shell(win1, SWT.APPLICATION_MODAL)

plus any other flags you are already using for the subordinate window.

Upvotes: 3

Related Questions