• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create model window

 
sunny chg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Pie
Posts: 50285
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50285
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way: Careful about spelling. Do you want model windows or modal windows?
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duh! Whats a "model" window? I was under the impression it was a typo and the OP meant modal.
 
sunny chg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Campbell,
it was just spelling mistake i wanted to mean modal ...
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50285
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic