Okay, so I have this code below and I keep getting run-time errors and I'm thinking its a flaw in the codes logic. I'm trying to use the setOneOtherPicture method to pick a picture and set it into an array to be later called on to be displayed in the showArtCollection method. I've been given two parameters, which and pRef. Can someone help me with this? Thanks.
public class House
{
String owner;
Picture pRef;
Picture favPic;
Picture [] picArray = new Picture [3];
public void showArtCollection ()
{
ArtWall aWall = new ArtWall(600,600);
aWall.copyPictureIntoWhere(favPic,250,100);
aWall.copyPictureIntoWhere(pRef,51,330);
aWall.copyPictureIntoWhere(pRef,151,330);
aWall.copyPictureIntoWhere(pRef,351,280);
aWall.show();
}
public void setOneOtherPicture (int which, Picture pRef)
{
this.picArray [which] = new Picture (FileChooser.pickAFile ());
}
public static void main (String [] args)
{
House PhDsHouse = new House ("Mad PH.D.");
Picture favPic = new Picture ();
Picture pRef = new Picture ();
PhDsHouse.setOneOtherPicture (0, pRef);
PhDsHouse.setOneOtherPicture (1, pRef);
PhDsHouse.setOneOtherPicture (2,pRef);
PhDsHouse.showArtCollection ();
}