View Full Version : locking a window in Java Swing

04-07-2005, 01:52 PM
Is there a way to lock a window in java swing, what i simply mean is i have a small GUI that appears in front of a larger one, and i dont want the user to be able to click anywhere else untill they have finished with the smaller gui.

hope this makes sense.

thanks in advance

04-07-2005, 04:02 PM
Small dialog windows are modal (they block all other windows), but Im not sure about regular windows.

link (http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#overview)

04-07-2005, 04:31 PM
Yeah, use JDialog instead of JFrame for the smaller window. Then pass the owner JFrame to the JDialog constructor.