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


Groups > comp.lang.java.gui > #3726

Re: Weird window close be

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: Weird window close be
Message-ID <O8qdnajPSNie8_nVnZ2dnUVZ_sudnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <48646bcc$0$4091$b9f67a60@news.newsdemon.com>
References <48646bcc$0$4091$b9f67a60@news.newsdemon.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 26
Date Wed, 27 Apr 2011 15:46:34 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303919194 96.60.20.240 (Wed, 27 Apr 2011 10:46:34 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:46:34 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:3726

Show key headers only | View raw


  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


Thread

Re: Weird window close be "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web