| Author |
Java
|
Richard Mendoza
Ranch Hand
Joined: Feb 26, 2003
Posts: 48
|
|
|
I have a command button named CLOSE in my swing frame. I want to close a swing frame after clicking the command button named CLOSE. What shall I command in the actionPerformed() method?
|
 |
Richard Teston
Ranch Hand
Joined: Feb 12, 2002
Posts: 89
|
|
|
Ei, Pare mali ka ng topic na i post, doon ka dapat sa Swing/AWT/JFC, anyway answering your question use System.exit(0) under actionPerformed method.
|
The Code is the Programmer
|
 |
Ajith Kallambella
Sheriff
Joined: Mar 17, 2000
Posts: 5782
|
|
|
Moving to Swing/AWT/JFC forum,...
|
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
System.exit(0) will indeed close the frame, however, this will also close ALL your frames if you have any others running within the same application. If you just need to close a frame without actually exiting the application, use myFrame.dispose() method.
|
 |
 |
|
|
subject: Java
|
|
|