public int getTolerance(){
        JOptionPane jop = new JOptionPane("Input"); //Create a pane
        String check = jop.showInputDialog(null,"Please enter the tolerance"); //Ask the question
        boolean numValid = true; //Assume the number is valid
        int count = 0; //Create a variable the string can get passed into
        if(isInteger(check)){ //Check to see if the string is a number
            count = Integer.parseInt(check); //Convert the string into an integer
            if(count < 0 ) //Check to see if the tolerance is negative
                numValid = false; //This is a bad value so try again
        }
        else{
            numValid = false; //This is not a number, so we need to ask again
        }

        if(!numValid){ //Check to see if the number is positive
            while(true){ //Loop until there is a valid number
                jop.showMessageDialog(null,"Sorry try a number that is greater than or equal to 0"); //Create a popup
                check = jop.showInputDialog(null,"Please enter the tolerance"); //Ask for input
                if(isInteger(check)){ //Check if the new string is a number
                    count = Integer.parseInt(check); //Convert the string into a number
                    if(count >= 0 ) //Check to see if the number is valid
                        break; //Exit
                }
            }
        }

        return count; //Return the number
    }