Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5293
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Newsgroups | comp.lang.java.gui |
| Subject | Re: Outside of the EDT: JOptionPane.showMessageDialog |
| Date | 2012-12-29 10:38 -0500 |
| Organization | The Wasteland |
| Message-ID | <nospam-0E3B0C.10384729122012@news.aioe.org> (permalink) |
| References | (2 earlier) <showMessageDialog-20121227071317@ram.dialup.fu-berlin.de> <nospam-D5E268.10234727122012@news.aioe.org> <EDT-20121227165216@ram.dialup.fu-berlin.de> <nospam-68BF57.16343427122012@news.aioe.org> <EDT-20121227231618@ram.dialup.fu-berlin.de> |
In article <EDT-20121227231618@ram.dialup.fu-berlin.de>,
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
> public class Main
> { public static void main( final java.lang.String[] args )
> { final javax.swing.JFrame frame = new javax.swing.JFrame( "Hallo Swing!" );
> frame.setDefaultCloseOperation( javax.swing.JFrame.EXIT_ON_CLOSE );
> frame.setVisible( true ); }}
>
> It hurts somewhat to see this, but this example appears
> just after the introduction of »new«, and makes the effect
> of »new« visible somehow, so I thought it might be a good
> motivation. In a sense, a JFrame is a »visible object«, so
> this example visualizes objects, which might help to learn.
> But I have not yet introduced interface implementations, and
> so I cannot yet implement java.lang.Runnable.
This seems like a reasonable compromise. When returning to the
topic, the example is simple enough to trace execution and show
that, while a particular implementation may be thread-safe,
there is no general assurance without starting on the EDT. The
didactic problem is complicated by the fact that incorrect
examples rarely fail reliably, and examples that fail reliably
are often so contrived as to to be obviously incorrect.
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
Re: Outside of the EDT: JOptionPane.showMessageDialog Knute Johnson <nospam@knutejohnson.com> - 2012-12-26 22:03 -0800
Re: Outside of the EDT: JOptionPane.showMessageDialog "John B. Matthews" <nospam@nospam.invalid> - 2012-12-27 10:23 -0500
Re: Outside of the EDT: JOptionPane.showMessageDialog Knute Johnson <nospam@knutejohnson.com> - 2012-12-27 09:06 -0800
Re: Outside of the EDT: JOptionPane.showMessageDialog "John B. Matthews" <nospam@nospam.invalid> - 2012-12-27 16:16 -0500
Re: Outside of the EDT: JOptionPane.showMessageDialog "John B. Matthews" <nospam@nospam.invalid> - 2012-12-27 16:34 -0500
Re: Outside of the EDT: JOptionPane.showMessageDialog "John B. Matthews" <nospam@nospam.invalid> - 2012-12-29 10:38 -0500
Re: Outside of the EDT: JOptionPane.showMessageDialog Lew <lewbloch@gmail.com> - 2012-12-31 12:00 -0800
csiph-web