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


Groups > comp.lang.java.programmer > #35462

Re: How do I terminate a JVM properly?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How do I terminate a JVM properly?
Date 2016-08-25 16:58 -0400
Organization A noiseless patient Spider
Message-ID <npnm5m$ok$1@dont-email.me> (permalink)
References (3 earlier) <7b27f662-d2e0-4649-8e4d-5e14e790bd14@googlegroups.com> <e287viFdr8sU1@mid.individual.net> <4fe5062e-9db3-4e91-9cfb-deeb8d51461a@googlegroups.com> <npnig2$jgv$1@dont-email.me> <49be993f-a1dc-4dc8-a034-6d763cf09a8c@googlegroups.com>

Show all headers | View raw


On 8/25/2016 4:35 PM, Eric Douglas wrote:
> On Thursday, August 25, 2016 at 3:55:57 PM UTC-4, Eric Sosman wrote:
>>      Nigel's nailed it.  Quoth the Javadoc for JDialog: "The value is
>> set to HIDE_ON_CLOSE by default."  (You've got to hunt a bit for it:
>> The text is not in the "up front" material for the class, the way it
>> is for JFrame, but down in the setDefaultCloseOperation() description.)
>
> Right...JFrame does tell you it does a hide on close by default right in the top block of the Javadoc while the JDialog is only documented under that method, I just had guessed for the simple sample the default would be to dispose (because who assumes you want to reuse a window after you close it?).

     I can't recall re-using a closed JFrame, but I re-use JDialogs more
often than not.  They're for notifications (often via JOptionPane, but
sometimes customized), or more frequently for data entry -- and why
re-construct the whole data entry form again, just because the user
has finished describing one item and moves on to the next?

     YMMV, naturally.

> [...]
> The confusing part is a JVM never terminates without calling System.exit() if the user has the Java Console visible, unless they click the Close button on that console.  Though everything else is properly disposed, that console holds it open. [...]

     I seldom use a console window, but this behavior makes sense.  The
user may want to read the application's last-gasp console message before
it disappears:

	The application has encountered a fatal error. Please contact
	Technical support immediately and provide these syndrome codes:

	    0x00EB9C4408 0x0000ED64 0x231

	                             > vanish <

	                  > "Hey, where'd those codes go?" <

-- 
esosman@comcast-dot-net.invalid
The Tooth Fairy has gone high-tech, now pays in Bitecoin.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-24 08:14 -0700
  Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-24 14:00 -0700
    Re: How do I terminate a JVM properly? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-24 17:39 -0400
      Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-25 05:24 -0700
        Re: How do I terminate a JVM properly? Nigel Wade <nmw@local.domain> - 2016-08-25 13:52 +0100
          Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-25 06:05 -0700
            Re: How do I terminate a JVM properly? Nigel Wade <nmw@local.domain> - 2016-08-25 15:04 +0100
              Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-25 08:20 -0700
            Re: How do I terminate a JVM properly? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-25 15:55 -0400
              Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-25 13:35 -0700
                Re: How do I terminate a JVM properly? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-25 16:58 -0400
                Re: How do I terminate a JVM properly? Arne Vajhøj <arne@vajhoej.dk> - 2016-08-28 13:29 -0400
                Re: How do I terminate a JVM properly? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-28 13:53 -0400
                Re: How do I terminate a JVM properly? Arne Vajhøj <arne@vajhoej.dk> - 2016-08-28 14:14 -0400
        Re: How do I terminate a JVM properly? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-25 05:52 -0700
    Re: How do I terminate a JVM properly? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-24 18:19 -0400
    Re: How do I terminate a JVM properly? Lew <lewbloch@gmail.com> - 2016-08-24 16:12 -0700
    Re: How do I terminate a JVM properly? Roedy Green <inquiry@mindprod.com> - 2016-08-30 16:34 -0700

csiph-web