Reputation: 341
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
Reputation: 200168
Use
win2 = new Shell(win1, SWT.APPLICATION_MODAL)
plus any other flags you are already using for the subordinate window.
Upvotes: 3