Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5266

Re: JFrame.DISPOSE_ON_CLOSE

From Joerg Meier <joergmmeier@arcor.de>
Newsgroups comp.lang.java.gui
Subject Re: JFrame.DISPOSE_ON_CLOSE
Date 2012-11-02 23:40 +0100
Message-ID <17fwhfp9tq5o3.fn8m3zf8dct7.dlg@40tude.net> (permalink)
References <k71hp3$is5$1@dont-email.me>

Show all headers | View raw


On Fri, 02 Nov 2012 15:34:06 -0700, Knute Johnson wrote:

> I was working on a small project and put my usual closing code in on the 
> JFrame menu and the program doesn't end.  I think I remember it doing 
> that before but maybe I'm losing my mind again.

>                  quit.addActionListener(new ActionListener() {
>                      public void actionPerformed(ActionEvent ae) {
>                          f.setVisible(false);
>                      }
>                  });

> Close the window with the X in the upper corner and the program exits. 
> Use the File Quit menu and it never exits.  I thought setting 
> DISPOSE_ON_CLOSE would cause it to end or have I completely forgotten 
> something.

All you do is set the JFrame to invisible. You forgot to add some code to
close or dispose it. A Component does not get disposed just because it's
invisible, since someone might want to set it to visible again later.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JFrame.DISPOSE_ON_CLOSE Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-11-02 15:34 -0700
  Re: JFrame.DISPOSE_ON_CLOSE Joerg Meier <joergmmeier@arcor.de> - 2012-11-02 23:40 +0100
  Re: JFrame.DISPOSE_ON_CLOSE markspace <-@.> - 2012-11-02 15:40 -0700
  Re: JFrame.DISPOSE_ON_CLOSE Roedy Green <see_website@mindprod.com.invalid> - 2012-11-06 21:27 -0800

csiph-web