String input = JOptionPane.showInputDialog("Please Type in 1 to find the area of another room");
oops, that may have been my bad. don't re-declare input. It should be:
input = JOptionPane.showInputDialog("Please Type in 1 to find the area of another room");
and you've got an extra set of brackets in the areaOfRoom method. I don't know if it'll give you a compiler error, but it's not necessary.
public static void areaOfRoom(double length, double height, double width)
{
double area = 2*height*length+2*width*length+2*height*width;
if (lenght<0)
JOptionPane.showMessageDialog(null, "Lenght Can not be negative");
else if (height<0)
JOptionPane.showMessageDialog(null, "Height Can not be negative");
else if (width<0)
JOptionPane.showMessageDialog(null, "Width Can not be negative");
else
JOptionPane.showMessageDialog(null, "The Area of Rectangle is " + area);
}
else if (number<0) // Terminates the program
{
}
This last bit of code can be removed. There's no if statement now, it's a while loop.