Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame

 
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.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!