• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JFrame

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Frank Ertl for the information.
 
reply
    Bookmark Topic Watch Topic
  • New Topic