project does not "see" program arguments from run parameters box

I send parameters to my project, and though the args parameterdoesn't get them. How can this be possible?I use NEtbeans to run JAVA, and I put my arguments exactly the way explained in NETBEANS.Can anybody help please?
[247 byte] By [ronoga12a] at [2007-11-26 15:47:40]
# 1
I don't know about netbeans cpz i don't use it...but for args param wat u need is to use from cmd prompt.....run classname foloowed by wat value u wan to give to args.......
KayDeEa at 2007-7-8 22:07:06 > top of Java-index,Java Essentials,Java Programming...
# 2

How do you know it doesn't see them?

Try putting the following for loop into your main method and then decide

whether your program sees the arguments or not

for (String arg : args) {

System.out.println(arg);

}

if you used some name other than "args" for the String array in the parameter section of your main method declaration than replace "args" with the name you used.

If you still believe that your program does not "see" the arguments, then please post the main method of your program (as you should have done in the first place).

masijade.a at 2007-7-8 22:07:06 > top of Java-index,Java Essentials,Java Programming...
# 3

Thanks for your reply!

I'm sure because args.length is zero, and I watch args in Localwatch and ther's nothing there. I also print .

Now I use exactly args and nothing else.

If you ment I copy the main method - here it is :

public static void main( String[] args) {

System.err.println("in Client main");

if (args.length!=0){

System.err.println("port passed= "+port);

port = Integer.parseInt(args[0] ); }

else port = 5002;

FourInLineClient2 application = new FourInLineClient2 ();

application.setDefaultCloseOperation(

JFrame.EXIT_ON_CLOSE );

application.execute();

}

ronoga12a at 2007-7-8 22:07:06 > top of Java-index,Java Essentials,Java Programming...
# 4
Duplicated and replied to (also) here: http://forum.java.sun.com/thread.jspa?threadID=5127238
ChuckBinga at 2007-7-8 22:07:06 > top of Java-index,Java Essentials,Java Programming...
# 5

It seems okay, other than the fact that port is seemingly a static int class variable. That would, I think, be better solved by giving the "FourInLineClient" class a constructor that takes an int as a parameter so that the port can then be an instance variable rather than having to be a static class variable, but that is probably more personal preference than anything else. (at least I assume it is this class that uses that port variable and that includes the posted main method)

The only thing else I can say, is to follow the advice posted by ChuckBing in the other thread and make sure that you are entering the command line parameters correctly and if the problem persists post on the NetBeans mailing list.

masijade.a at 2007-7-8 22:07:06 > top of Java-index,Java Essentials,Java Programming...