• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame  RSS feed

 
Indika Hewage
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have two JFrames in the application. Second JFrame creates on top of the frist JFrame (main Frame). I need to disable first JFrame (main) until the users close the second Jframe (second frame act like a JDialog). Is it possible to do that?

Thanks.
 
Frank Ertl
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you use a JFrame for the second window? If you used a JDialog you could make it modal. So the first JFrame is disabled automatically.
If you really need a JFrame you disable the first JFrame by calling jframe1.setEnabled(false) and then use a WindowListener that calls jFrame1.setEnabled(true) when it receives the closingEvent from JFrame2.
 
Indika Hewage
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank Ertl for the information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!