why sun recommends this way
From: Madhur Ahuja (ef_at_df.com)
Date: 08/24/04
- Previous message: John: "Re: How can I trap UI events non-intrusively?"
- Next in thread: Adam: "Re: why sun recommends this way"
- Reply: Adam: "Re: why sun recommends this way"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Aug 2004 03:32:21 +0530
Hello
The final bit of code in HelloWorldSwing--and in all of our examples--looks
like this:
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
/* create and show the GUI */
}
});
You can copy this code and use it as-is. It might look daunting, but we
recommend it because it ensures that the GUI won't have a thread-safety
problem that could break the UI before it even appears onscreen.
Can anybody explain me, why this is the preferred method of creating GUI
program.
-- Winners dont do different things, they do things differently. Madhur Ahuja India Homepage : http://madhur.netfirms.com Email : madhur<underscore>ahuja<at>yahoo<dot>com
- Previous message: John: "Re: How can I trap UI events non-intrusively?"
- Next in thread: Adam: "Re: why sun recommends this way"
- Reply: Adam: "Re: why sun recommends this way"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|