Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #6581
| From | lewbloch <lewbloch@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: A question about some long java code that has getters/setters |
| Date | 2011-07-26 09:00 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <1e93de3e-9abc-43ef-8d51-18d7401d6632@t38g2000prj.googlegroups.com> (permalink) |
| References | <d94f5902-8b2e-484f-8095-9ce034e916d4@t8g2000prm.googlegroups.com> <1672e2f1-a963-4fcf-b651-41b69432c9d7@p29g2000pre.googlegroups.com> <4e2b58a2$0$309$14726298@news.sunsite.dk> |
Arne Vajhøj wrote:
> lewbloch wrote:
>> Chad wrote:
>>> The following code, which is taken from one of my school books,
>>> displays 4 different boxes inside a gui [sic]
>>>
>>> import java.awt.*;
>>> import javax.swing.*;
>>>
>>> public class TestMessagePanel extends JFrame {
>>>
>>> public TestMessagePanel() {
>>> ...
>>> }
>>>
>>> public static void main(String[] args) {
>>> TestMessagePanel frame = new TestMessagePanel();
>>> frame.setSize(300, 200);
>>> frame.setTitle("TestMessagePanel");
>>> frame.setLocationRelativeTo(null);
>>> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>>> frame.setVisible(true);
>>>
>>> }//end main()
>>>
>>> }
>>> ...
>
>> The problem with this code is that it teaches the bad and bug-prone
>> practice of creating GUI elements on the main thread instead of the
>> EDT. Don't use this book. The author apparently didn't know what he
>> was doing.
>> ...
>> But you should never, never, never do GUI magic off the EDT!
>
> Maybe the book is just not new.
>
> It was common practice to initiate the Swing form from the
> main thread for some years until people got aware of the
> potential issue.
That may be the excuse, but it doesn't improve the usefulness of the
book. He should still get a book that shows the correct idioms.
And it isn't a potential issue, it's an actual issue.
--
Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
A question about some long java code that has getters/setters Chad <cdalten@gmail.com> - 2011-07-22 16:12 -0700
Re: A question about some long java code that has getters/setters Arne Vajhøj <arne@vajhoej.dk> - 2011-07-22 19:28 -0400
Re: A question about some long java code that has getters/setters Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-07-22 23:31 +0000
Re: A question about some long java code that has getters/setters markspace <-@.> - 2011-07-22 16:51 -0700
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-23 09:02 -0700
Re: A question about some long java code that has getters/setters blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-23 17:41 +0000
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-23 11:42 -0700
Re: A question about some long java code that has getters/setters Arne Vajhøj <arne@vajhoej.dk> - 2011-07-23 17:59 -0400
Re: A question about some long java code that has getters/setters Steve Sobol <sjsobol@JustThe.net> - 2011-07-23 23:39 -0700
Re: A question about some long java code that has getters/setters blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-25 19:44 +0000
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 09:03 -0700
Re: A question about some long java code that has getters/setters Arne Vajhøj <arne@vajhoej.dk> - 2011-07-23 19:26 -0400
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 09:00 -0700
Re: A question about some long java code that has getters/setters Patrick May <patrick@softwarematters.org> - 2011-07-25 16:27 -0400
Re: A question about some long java code that has getters/setters markspace <-@.> - 2011-07-25 15:14 -0700
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-25 15:56 -0700
Re: A question about some long java code that has getters/setters Patricia Shanahan <pats@acm.org> - 2011-07-25 17:00 -0700
Re: A question about some long java code that has getters/setters Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-25 21:17 -0400
Re: A question about some long java code that has getters/setters markspace <-@.> - 2011-07-25 16:50 -0700
Re: A question about some long java code that has getters/setters Gene Wirchenko <genew@ocis.net> - 2011-07-25 18:30 -0700
Re: A question about some long java code that has getters/setters Patricia Shanahan <pats@acm.org> - 2011-07-25 18:41 -0700
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 09:05 -0700
Re: A question about some long java code that has getters/setters Gene Wirchenko <genew@ocis.net> - 2011-07-26 10:48 -0700
Re: A question about some long java code that has getters/setters Gene Wirchenko <genew@ocis.net> - 2011-07-26 11:56 -0700
Re: A question about some long java code that has getters/setters Patricia Shanahan <pats@acm.org> - 2011-07-26 13:34 -0700
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 14:21 -0700
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 14:20 -0700
Re: A question about some long java code that has getters/setters Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-25 21:35 -0400
Re: A question about some long java code that has getters/setters Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-26 06:59 -0300
Re: A question about some long java code that has getters/setters Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2011-07-26 12:19 +0300
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-26 09:08 -0700
Re: A question about some long java code that has getters/setters Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2011-07-27 15:56 +0300
Re: A question about some long java code that has getters/setters lewbloch <lewbloch@gmail.com> - 2011-07-27 14:14 -0700
csiph-web