aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to make form Modal??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make form Modal???" Watch "How to make form Modal???" New topic
Author

How to make form Modal???

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

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.


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
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

Joined: Sep 25, 2004
Posts: 156

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

Joined: May 18, 2004
Posts: 434
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
 
 
subject: How to make form Modal???