Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4392
| From | "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Sharing ListSelection |
| Message-ID | <48fb39b0$1@news.uni-rostock.de> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <dNadnR53z6_X_2fVnZ2dnUVZ_judnZ2d@comcast.com> |
| Date | 2011-04-27 15:50 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Lew schrieb: > Lew schrieb: >... > From the Swing tutorial, > <http://java.sun.com/docs/books/tutorial/uiswing/concurrency/initial.html> >> An initial thread schedules the GUI creation task by invoking >> javax.swing.SwingUtilities.invokeLater or >> javax.swing.SwingUtilities.invokeAndWait. > ... >> Why does not the initial thread simply create the GUI itself? Because >> almost all code that creates or interacts with Swing components must >> run on the event dispatch thread. > > Also, see the paragraph on "Main Method" and associated example from: > <http://en.wikibooks.org/wiki/Java_Programming/SwingLargeExamples> > > Understand that the documentation for Swing says that ALL methods and > components must be accessed only from the EDT unless explicitly marked > thread-safe. They make no exception for constructors. > <http://java.sun.com/docs/books/tutorial/uiswing/concurrency/dispatch.html> > > The reason is that the threading model could allow EDT events to begin > before the constructor completes unless you adhere to the dictum. State > might not transfer correctly between threads, given the memory model. > > Such anomalies were observed in the field, which is why Sun updated its > documentation. They used to go ahead and tell people to construct GUIs > on the initial thread, but now no longer. > Thanks alot for enlightening me Lew. Even though it means I need to change some code of mine ;) Stefan --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
Sharing ListSelectionMode "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Sabine Dinis Blochberger" <sabine.dinis.blochberger@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
Re: Sharing ListSelection "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:50 +0000
csiph-web