This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 20078
    
  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: 20078
    
  30

Suppose this is your second JFrame now:

You can simply change this to a JDialog as follows:
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: jFrame Closing Solution
 
It's not a secret anymore!