GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes how to enforce the user to close the frame before proceed to another frame? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to enforce the user to close the frame before proceed to another frame?" Watch "how to enforce the user to close the frame before proceed to another frame?" New topic
Author

how to enforce the user to close the frame before proceed to another frame?

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
something like this........thanks in advance


[Thumbnail for Untitled.jpg]

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2190
    
    7
In general an application should only use a single main JFrame. For other popup windows you should use a JDialog. In this case you would want to use a model JDialog which will force the user to close the dialog before continuing.
kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
sry..i dun get it....can write down some sample code?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2190
    
    7
You create JDialogs the same way you create a JFrame.

Or in your case you may be able to use a JOptionPane which creates the JDialog for you.

Start by reading the Swing tutorial on: How to Make Dialogs
 
GeeCON Prague 2014
 
subject: how to enforce the user to close the frame before proceed to another frame?