Dispose window without shutting down whole program

I'm back again :P I have this program that opens up a window. There's options menu that opens in a new window and what I want to happen is when I close the options window, it doesn't shut the program down. I know that

setDefaultCloseOperation(); 

Will close down my window but I looked at the documentation and it doesn't have a solution for my problem. Can anyone be kind enough to help? Thanks (:

Answers


// different close actions are available, that do different things!
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 

But see also, The Use of Multiple JFrames, Good/Bad Practice? Sneak preview, the answer is: Bad (bad, bad) practice.

..(will) look into other window managers

It is not so much 'window' managers we need here as 'view' managers. Those views (e.g. each in a panel) might then be managed by dialogs, option panes, pop-ups, tool bars, layout managers, (very rarely) other frames or windows..

The content you mention seems well suited to being displayed in a (possibly modal) dialog.


Need Your Help

When do programmers use Empty Base Optimization (EBO)

c++ class optimization memory-management compiler-optimization

I was reading about Empty Base Optimization(EBO). While reading, the following questions popped up in my mind:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.