I'm hoping some of you are familiar with the Processing development environment for Java. I've searched the site, but wasn't able to find too much. So I'm supposed to be passing command-line arguments from the 'args' string array from

```
public static void main(String[] args )

```

...to arrays in a setup() function so that I can parse them and use them as values for the heights of bar graphs, which are to be drawn on a graphical window. I don't understand why I keep getting a NullPointerException error at line 16...

```
for(int i = 0; i < tempArgs.length; i++) {
    dataArray[i] = Integer.parseInt(tempArgs[i]);
}

```

.....as I thought the tempArray array should have values in it, which seems to be bourne out by the System.out.println statement I used to test this at the end of the main method. Here's the whole code, it's quite short. Any help would be much appreciated.

```
public class Main extends PApplet {
    int[] dataArray ;
    int[] normalizedData;
    String[] tempArgs;

    @Override
    public void setup() {
        /*size(dataArray[2], dataArray[3]);
        smooth();
        background(255);*/
        for(int i = 0; i < tempArgs.length; i++) {
            dataArray[i] = Integer.parseInt(tempArgs[i]);
        }

        int max = dataArray[0];
        for(int i = 0; i < dataArray.length; i++) {
            if(dataArray[i] > max) {
                max = dataArray[i];
            }
        }

        for(int i = 0; i < dataArray.length; i++) {
            normalizedData[i] = (dataArray[i] / max) * (height - 20);
        }

        for(int i = 0; i < normalizedData.length; i++) {
            fill(255,34,65);
            rect(3, 5, 10, normalizedData[i]);
        }

        size(dataArray[2], dataArray[3]);
        smooth();
        background(255);

     }

    public static void main(String[] args) {
        String[] tempArgs = new String[args.length + 2];
        tempArgs[0] = "--bgcolor=#FFFFFF";
        tempArgs[1] = "project1.Main";
        for(int i = 2; i < tempArgs.length; i++) {
            tempArgs[i] = args[i-2];
        }
        System.out.println(tempArgs.length);
          PApplet.main(tempArgs);          
    }
}

```