wood burning stoves*
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 Soft Skills this week in the Jobs Discussion 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: 19784
    
  20

Use a modal JDialog instead.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 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: 19784
    
  20

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