I wish to use args passed to main(String[]) during application execution to a Swing component.
In a simple example, assume args passed are: a b c d
And here is the result I look for:
package argsinswing; import javax.swing.JOptionPane; public class ArgsInSwing { public static void main(String[] args) { String str1 = args[0]; String str2 = args[1]; String str3 = args[2]; String str4 = args[3]; JOptionPane.showMessageDialog(null, str1 + ", "+ str2 + ", "+ str3 + ", " str4, "Args are:" ,JOptionPane.PLAIN_MESSAGE); } }