Calling this method
Super noobie question but I don't have a clue..
I dont know how to call the changeWhole method in the main method without getting any errors.
public void changeWhole(double amount)
Pixel pixelArray = this.getPixels();
Pixel pixel = null;
int value = 0;
int i = 0;
while( i < pixelArray.length)
pixel = pixelArray[i];
value = pixel.getBlue();
pixel.setBlue((int) (value * amount));
public static void main(String args)
String fileName = FileChooser.pickAFile();
Picture pictObj = new Picture(fileName);
Is the class this method resides in "Picture"? If so, you can just use in the main:
pictObj.changeWhole(50.0); for example. That should be the correct way to call it.
That doesn't mean you won't get other errors, but the method itself appears to be written to prevent errors as much as possible. The only one that should be possible to throw an error is pixelArray.length, which will only occur if this.getPixels() returns void or null.
That assumes you are not referring to a compilation error though.