Results 1 to 6 of 6
Thread: Closing a JFrame
- 11-22-2009, 07:40 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 9
- Rep Power
- 0
Closing a JFrame
Hi there,
Ive created a program thats essentially a address book GUI. In this i have a function that allows u to add a contact. When this is clicked it creates a new JFrame my question is what code can i use to create a JButton that will just exit that JFrame and not close the program.
cheers
simon
-
Don't create and show another JFrame. Instead create and show a JDialog, and then you can simply call dispose on the dialog when you're done with it.
- 11-22-2009, 07:46 PM #3
Member
- Join Date
- Nov 2009
- Posts
- 9
- Rep Power
- 0
Ive already created another JFrame...
- 11-22-2009, 09:26 PM #4
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Well, now is a good time to learn normal programming conventions. An application typically has a single JFrame and multiple helper JDialogs that popup for additional information/functionality. To change your code all you need to do is change "Frame" to "Dialog".Ive already created another JFrame...
- 11-22-2009, 11:24 PM #5
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
Now is also a good time to start taking or ignoring advice instead of arguing about it.
- 11-23-2009, 02:54 PM #6
Member
- Join Date
- Nov 2009
- Posts
- 96
- Rep Power
- 0
Similar Threads
-
Closing Popup JFrame in Applet
By Arsenic in forum Java AppletsReplies: 3Last Post: 04-10-2009, 08:37 PM -
Can i use a resultset more than once without closing it
By haneeshrawther in forum JDBCReplies: 5Last Post: 06-26-2008, 03:16 AM -
JFrame (closing under a condition)
By Java Tip in forum Java TipReplies: 0Last Post: 03-12-2008, 11:17 AM -
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