By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,798 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,798 IT Pros & Developers. It's quick & easy.

Close JFrame

P: n/a
Hello, all !!!

Tell me plz, which function closes JFrame.
I want to close it by button "Close".

Thanx
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
//try in the constructor

addWindowListener( new WindowAdapter() {
public void windowClosing ( WindowEvent evt ) {
System.exit(0);
}
} );

"Alex Ostrikov" <ao*****@hotmail.com> wrote in message
news:VQTvb.602$Yt4.425@lakeread05...
Hello, all !!!

Tell me plz, which function closes JFrame.
I want to close it by button "Close".

Thanx

Jul 17 '05 #2

P: n/a
frame.dispose();

http://java.sun.com/j2se/1.4.1/docs/....html#dispose()

Alex Ostrikov wrote:
Hello, all !!!

Tell me plz, which function closes JFrame.
I want to close it by button "Close".

Thanx

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.