Re: Self-configuring classes
- From: JackT <jackt123@xxxxxxxxx>
- Date: Sat, 04 Aug 2007 06:18:23 -0000
On Aug 4, 5:58 am, nebulou...@xxxxxxxxx wrote:
Some obscure blog posting from a blog no-one reads.
That's your evidence against me?
Try Sun's official tutorial then:
http://java.sun.com/docs/books/tutorial/uiswing/concurrency/initial.html
They now say that you should put the creation of GUI
into a separate Runnable, and invoke it via
SwingUtilities.invokeLater.
(One of their old online demo code often deadlocks,
and they finally found out it was because they didn't
postpone everything until the EDT. So now they advocate
all GUI calls must only be done via the EDT unless
the GUI method's javadoc specifically says it is thread-safe)
I haven't reviewed any of the tutorials in some time, mainly because I
long since learned the basics backward and forward, but ISTR the
typical thing for them to do was ... invoke setVisible(true) or show()
on your main application frame from main().
That was the typical thing to do back then.
But it was prone to deadlocks; so now Sun advocates
using SwingUtilities.invokaLater instead.
Eh, until you've presented some UI my understanding has been that the
EDT doesn't even exist yet; it's created lazily. So invokeLater might
be waiting a very long time
No. Wrong again. The thread will be created if needed,
so it won't cause the deadlock that you fear.
Also, ISTR SwingUtilities being a third-party (but commonplace) class
not a standard Java class at all.
No. Wrong again. It's part of Java 5:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SwingUtilities.html
Now, go away. Your ignorance (and your obvious dishonesty
in your debating tactics is most unwelcome).
.
- Follow-Ups:
- Re: Self-configuring classes
- From: nebulous99
- Re: Self-configuring classes
- References:
- Self-configuring classes
- From: Chris
- Re: Self-configuring classes
- From: Piotr Kobzda
- Re: Self-configuring classes
- From: Lew
- Re: Self-configuring classes
- From: Twisted
- Re: Self-configuring classes
- From: Thomas Hawtin
- Re: Self-configuring classes
- From: Twisted
- Re: Self-configuring classes
- From: Thomas Hawtin
- Re: Self-configuring classes
- From: nebulous99
- Re: Self-configuring classes
- From: Owen Jacobson
- Re: Self-configuring classes
- From: nebulous99
- Self-configuring classes
- Prev by Date: Re: Java 7 features
- Next by Date: Re: Java 7 features
- Previous by thread: Re: Self-configuring classes
- Next by thread: Re: Self-configuring classes
- Index(es):
Relevant Pages
|