Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #3726
| From | "Lew" <lew@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Weird window close be |
| Message-ID | <O8qdnajPSNie8_nVnZ2dnUVZ_sudnZ2d@comcast.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <48646bcc$0$4091$b9f67a60@news.newsdemon.com> |
| Date | 2011-04-27 15:46 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Knute Johnson wrote: > So why wouldn't you construct a GUI in a GUI's constructor? That depends on your definition of "construction". The OP's code follows the idiom you're probably used to seeing, where the GUI is assembled, but that is not the same thing as object construction in the Java, or O-O sense. So let's be precise in our terminology, shall we, and ask why one wouldn't assemble the _GUI_ in the _object_'s constructor? The answer is what I said up front - it's a best practice not to do anything but construction (that's *object* construction, please avoid sophistry) in the object constructor. Properly speaking, the assembly of the GUI in an object, like the frame holder portrayed by both the OP's and my examples, should occur only after the object, the frame holder, is fully constructed. It was to show how one can translate that lip-service principle into practice that I presented the example. -- Lew --- * 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 | Find similar | Unroll thread
Re: Weird window close be "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
csiph-web