This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes jFrame Closing Solution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jFrame Closing Solution" Watch "jFrame Closing Solution" New topic
Author

jFrame Closing Solution

sa sam
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
i have 1 jFrame(main frame) & in that i have menu bar. on every click event of menu item it will show you a a new jFrames(child frames).
now my problem is, i want the result like when i click on 1 menu item it will show me jFrame(child) but it do not allow me another click on menu item before closing jframe(child)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20132
    
  30

Use a modal JDialog instead.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
sa sam
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
Rob Prime wrote:Use a modal JDialog instead.

can you give me a example?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20132
    
  30

Suppose this is your second JFrame now:

You can simply change this to a JDialog as follows:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jFrame Closing Solution
 
It's not a secret anymore!