Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
kahkean chor
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
something like this........thanks in advance
Untitled.jpg
[Thumbnail for Untitled.jpg]
 
Rob Camick
Ranch Hand
Posts: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sry..i dun get it....can write down some sample code?
 
Rob Camick
Ranch Hand
Posts: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!