aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes how to create model window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to create model window" Watch "how to create model window" New topic
Author

how to create model window

sunny chg
Greenhorn

Joined: Jun 09, 2008
Posts: 3
Hi all ,
i am aware that we can create modal dialog boxes .
can any buddy help me abt creating model window (or model JFrame)

thanks in advance ,
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10533
    
    9

Hi "Sunny c9". Welcome to the ranch.
Take a look at JDialog and this dialog tutorial here
Is that what you are looking for?

As a side note, you need to change your display name to reflect your real name. You can do that by clicking here.
Also do take out time to read the NamingPolicy


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40027
    
  28
Originally posted by Maneesh Godbole:
As a side note, you need to change your display name to reflect your real name.
Thank you very much for noticing. I have recorded the incorrect naming.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40027
    
  28
By the way: Careful about spelling. Do you want model windows or modal windows?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10533
    
    9

Duh! Whats a "model" window? I was under the impression it was a typo and the OP meant modal.
sunny chg
Greenhorn

Joined: Jun 09, 2008
Posts: 3
thanks Maneesh !!

my situation is like this suppose there is a one JFrame (suppose JFrame1) containning button ..while clicking button it will generete new JFrame.(JFrame2)
while closing JFrame1 , it will close both frames .... but i need to create modal frame which restrict to close frame one i.e. which insist to operate itself first ..
i.e. how to create that JFrame2 modal dialog

(.. hope i have clarified my need ...)
sunny chg
Greenhorn

Joined: Jun 09, 2008
Posts: 3
hi Campbell,
it was just spelling mistake i wanted to mean modal ...
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10533
    
    9

Originally posted by sunny chougule:
.... but i need to create modal frame which restrict to close frame one i.e. which insist to operate itself first ..


Take a look at JOptionPane. It has numerous useful showXXXDialog methods which create modal windows. The link I gave previously has the details on how to use JOptionPanes.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40027
    
  28
Agree that JOptionPane is the easiest way to get a modal top-level container, but they are not actually Windows; they are JDialogs.

And thank you for correcting your displayed name.
[ July 22, 2008: Message edited by: Campbell Ritchie ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create model window