[SOLVED] Passing parameters
What is wrong with this code? Here's my code, and below it is the error code that pops up in the interactions pane while running the program.
Still need help with the following code:
JOptionPane.showMessageDialog( null, "You have chosen T");
// the user will pick a picture
fileName = FileChooser.getMediaPath("twoKidsWall.jpg");
p = new Picture(fileName);
p.show();
JOptionPane.showMessageDialog( null, "This is the 1st picture that you picked");
p.hide();
// the user now picks the 2nd picture
fileName = FileChooser.getMediaPath("wall2.jpg");
oldBackground = new Picture(fileName);
oldBackground.show();
JOptionPane.showMessageDialog( null, "This is the 2nd picture that you picked");
oldBackground.hide();
// the user will pick a third picture
fileName = FileChooser.getMediaPath("bridge.jpg");
newBackground = new Picture(fileName);
newBackground.show();
JOptionPane.showMessageDialog( null, "This is the 3rd picture that you have chosen");
newBackground.hide();
// now the swapBackground method will run
threshold = validateDouble ("Enter a background and threshold double", 0.0, 200.0);
//p.swapBackground(oldBackground, newBackground, threshold);
p.swapBackground(oldBg, newBg, 50.0);//threshold);
Here is my error message:
java.lang.NullPointerException
at PA5BeckleyMain2ndTry.validateDouble(PA5BeckleyMain 2ndTry.java:289)
at PA5BeckleyMain2ndTry.main(PA5BeckleyMain2ndTry.jav a:217)
please help!::eek: