Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make form Modal???

 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

How can i make my form modal.

Let i have frmMain in which number of buttons are there for opening of other forms.

If i open my customer file then i must not be able to click my main form unless and until this customer file is closed.
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the JDialog class. When making it you pass in the parent of the JDialog which will make the JDialog appear over the parent and you will not be able to interact with the parent until the JDialog is closed.

Cheers,
Rachel
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m using Netbeans IDE 3.5.
by default all my forms are extended by "javax.swing.JFrame".

How can i make my form modal having "javax.swing.JFrame"
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't have a modal JFrame, that is one of the many reasons for JDialog. You will have to find out how to let NetBeans give you JDialogs, or you can just edit your frame to extend JDialog instead of JFrame.

Cheers,
Rachel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic