Newbie Help - Error no X method in X with arguments: ()
Hello all,
Every time I try to run the pict.flipHorizontal(); command in the interactions pane of Dr. Java, I continually get the messageError: No 'flipHorizontal' method in 'Picture' with arguments: ()even though the code below will compile correct. I'm able to view and explore the picture, so I'm not sure what I could be missing.
Any help would be greatly appreciated, thank you. My code is below, thanks.
publicclass FlippingPictureextends Picture
{
public FlippingPicture(String filename)
{
super(filename);
}
public FlippingPicture(int width,int height)
{
super(width,height);
}
public FlippingPicture flipVertical()
{
int width = this.getWidth();
int mirrorPoint = width / 2;
Pixel leftPixel =null;
Pixel rightPixel =null;
for (int y = 0; y < getHeight(); y++)
{
for (int x = 0; x < mirrorPoint; x++)
{
leftPixel = getPixel(x, y);
rightPixel = getPixel(width - 1 - x,y);
rightPixel.setColor(leftPixel.getColor());
}
}
returnnull;
}
public FlippingPicture flipHorizontal()
{
int height = this.getHeight();
int mirrorPoint = height / 2;
Pixel topPixel =null;
Pixel bottomPixel =null;
for (int x=0; x < getWidth(); x++)
{
for (int y=0; y < mirrorPoint; y++)
{
topPixel = getPixel(x,y);
bottomPixel = getPixel(x,height - 1 - y);
bottomPixel.setColor(topPixel.getColor());
}
}
returnnull;
}
}

