K
Kurt M Peters
Hello,
I understand how people normally would pass arguments to a program using
the command line using the Main method, but when using Swing people seem to
recommend starting the application in its own thread as shown below:
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new myJavaApplication().setVisible(true);
}
});
}
Normally, one could simply use args[] as an array, but since the
myJavaApplication is "encased" in an "invokeLater" internal method, I don't
see how to pass args to the application itself in any useful manner. Does
anyone have any suggestions for a way around this?
Regards,
Kurt
Normal way of using args (a possibility that's not possible using entrance
above):
if(null == args || args.length < 1) {
System.exit(1);
}
new myJaveApplication(args[0]);
I understand how people normally would pass arguments to a program using
the command line using the Main method, but when using Swing people seem to
recommend starting the application in its own thread as shown below:
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new myJavaApplication().setVisible(true);
}
});
}
Normally, one could simply use args[] as an array, but since the
myJavaApplication is "encased" in an "invokeLater" internal method, I don't
see how to pass args to the application itself in any useful manner. Does
anyone have any suggestions for a way around this?
Regards,
Kurt
Normal way of using args (a possibility that's not possible using entrance
above):
if(null == args || args.length < 1) {
System.exit(1);
}
new myJaveApplication(args[0]);