Results 1 to 5 of 5
- 08-25-2010, 02:38 PM #1
Member
- Join Date
- Aug 2010
- Posts
- 1
- Rep Power
- 0
Closing 1 Desktop App, But Not The Other
My main class, call it Main.java, calls a Desktop Application I created in Netbeans. After the user clicks a button, it returns to Main.java, which then calls another desktop application which I created with Netbeans. The thing is, if I close one of them, I end up closing both. Is there a way that I can just close one but not the other?
These GUIs (GUI1 and GUI2) are called by: I changed the main method in GUI1App.java and GUI2App.java to be called "launch" instead of main. Then in my Main.java, I just use
String[] args = {};
GUI1App app = new GUI1App();
app.launch(args};
- 08-25-2010, 03:29 PM #2
What method do you call to 'close' a "Desktop app"?if I close one of them, I end up closing both. Is there a way that I can just close one but not the other
Are the "app"s JFrame windows? Can you call setVisible(false) to hid a window?
- 08-25-2010, 10:35 PM #3
Cross posted
Swing - Closing 1 Desktop App, But Not The Other
db
-
Don't have multiple JFrames. Instead have your main app be a JFrame and the dialog window a JDialog (the tutorials will show you how), or even better, swap views with a CardLayout. Also you will benefit greatly by not using NetBeans to generate your Swing code, but rather to learn to code it yourself through the Sun / Oracle tutorials.
Luck.
-
Darryl, thanks for the heads up.
Original poster, please do not cross-post without notifying us as this behavior can make us duplicate effort that has been done elsewhere. If you've ever volunteered at a technical forum, you'll understand the frustration this causes.
Similar Threads
-
closing FileOutputStream?
By mgrootsch in forum New To JavaReplies: 1Last Post: 05-17-2010, 05:36 PM -
Closing a JFrame
By SBL in forum AWT / SwingReplies: 5Last Post: 11-23-2009, 02:54 PM -
Desktop app on an off-focus desktop
By thommy_lobo in forum Advanced JavaReplies: 0Last Post: 11-09-2009, 06:56 AM -
Closing an Editor
By janpol1 in forum EclipseReplies: 0Last Post: 02-14-2009, 04:00 PM -
Closing packages
By uncopywritable in forum New To JavaReplies: 0Last Post: 08-13-2007, 11:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks