Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: How to extend an array Date: Tue, 31 May 2016 11:56:16 -0400 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 31 May 2016 15:56:19 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="2d081e2f7155c28005d4472f67c2f43d"; logging-data="12474"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1Ma6Tz4RiUMI+9iJCSLN/" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 In-Reply-To: Cancel-Lock: sha1:bozyE9aQ/RDGYLse8+GvqN3ZKjs= Xref: csiph.com comp.lang.java.programmer:34425 On 5/31/2016 11:52 AM, Eric Sosman wrote: > [...] > One simple way to ensure that construction happens on the EDT: > > public static void main(String[] args) { > SwingUtilities.invokeLater(new Runnable() { > Class2 myWindow = new Class2(); > ... et cetera ... > myWindow.setVisible(true); > }); > > (The fashion nowadays is to use a "lambda expression" instead of an > explicit "new Runnable()", but I didn't want to risk spooking you.) ... and while de-lambda-izing my spooky example, I botched it. Sorry; that should have been public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Class2 myWindow = new Class2(); ... et cetera ... myWindow.setVisible(true); } }); (Sigh.) -- esosman@comcast-dot-net.invalid "Don't be afraid of work. Make work afraid of you." -- TLM