• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to disable parent jframe when child jframe is active

 
sunil ingalagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
Please anyone tell me as how to disable parent frame or window when
child frame is active.


when i click on a jbutton on one frame, a new frame will open. while this new frame is open i want to disable the first frame. like disabling any mouse click on first window. and when i close new frame then i have to enable first frame. and both the frames have main method in them.

and if i have to do this in net beans then how to do it?

thanks in advance for any help....
 
Rob Camick
Ranch Hand
Posts: 2564
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use a "child frame". Instead use a "modal JDialog".
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the API for JOptionPane class. It has numerous showXXXDialog methods which will help you setup a modal dialog easily.
 
sunil ingalagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Don't use a " child frame". Instead use a "modal JDialog".


Thank you very much Rob
 
sunil ingalagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Check out the API for JOptionPane class. It has numerous showXXXDialog methods which will help you setup a modal dialog easily.


Thanks maneesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic