kohinoor2007
Programmer
Hi all,
Iam developing an applet in which ,I have overrided the init,start,stop & destroy methods.Iam using the j2sDK 1.4.
In the "init" method,I want to create and show the GUI.(That means dont want to load any data into the controls in the GUI).
Have a method createAndShowGui()--->which does that & is called from Applet "init".
In the "start" method,Iam loading the initial Datas that need to be loaded into the controls.
Have a method loadInitialData()--->which does that & is called from Applet "start".
Now,I have the following questions:
[1]Have read in the java tutorials that I should be using
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run()
{
//
}
}
And inside the "run" method,I should be putting my calls to swingcomponents, as they are not mulltithreaded supported.
Now which of my above said 2 methods("createAndShowGui",which is called from "init" & "loadInitialData",which is called from "start"),should be put under "Run".
[2]Where should be the listeners added,in the method("createAndShowGui") called from "init" or from the method("loadInitialData") called from "start"
[3]"javax.swing.SwingUtilities.invokeLater"- What does it do?.Does it create a thread.
If yes,Do I have to explicitly remove it from the Applet "stop"or "destroy" methods.How ca I remove it then..
Thanks
Iam developing an applet in which ,I have overrided the init,start,stop & destroy methods.Iam using the j2sDK 1.4.
In the "init" method,I want to create and show the GUI.(That means dont want to load any data into the controls in the GUI).
Have a method createAndShowGui()--->which does that & is called from Applet "init".
In the "start" method,Iam loading the initial Datas that need to be loaded into the controls.
Have a method loadInitialData()--->which does that & is called from Applet "start".
Now,I have the following questions:
[1]Have read in the java tutorials that I should be using
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run()
{
//
}
}
And inside the "run" method,I should be putting my calls to swingcomponents, as they are not mulltithreaded supported.
Now which of my above said 2 methods("createAndShowGui",which is called from "init" & "loadInitialData",which is called from "start"),should be put under "Run".
[2]Where should be the listeners added,in the method("createAndShowGui") called from "init" or from the method("loadInitialData") called from "start"
[3]"javax.swing.SwingUtilities.invokeLater"- What does it do?.Does it create a thread.
If yes,Do I have to explicitly remove it from the Applet "stop"or "destroy" methods.How ca I remove it then..
Thanks