running apps with args [message #129974] |
Mon, 16 January 2006 13:47  |
Eclipse User |
|
|
|
Originally posted by: ashiers.hfx.eastlink.ca
Hi there,
I downloaded Eclipse and decided to try it out. I wanted to run my first
app with arguements passed to the main(...) method. Where in the IDE is
the place where I enter the arguements that are to be passed to the
main(...) method when executing the app?
Alan
import javax.swing.*;
public class HelloWorld
{
/**
* @param args
*/
public static void main(String[] args)
{
if(args.length == 0)
JOptionPane.showMessageDialog(null, "You didn't include any
arguements. Nothing to display.");
else
{
for(int i = 0; i < args.length; i++)
System.out.println(args[i]);
}
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09403 seconds