public void checkConfirmation(){
        if (!charName.getText().matches("^[\\w]+$")){ // Name has invalid characters
            gameDialog = new Dialog("Name can only have letters or numbers."
                    + "Please re-enter");
            if (confirmName != true){ // Shows error message
                gameDialog.showErrorMsg();
                charName.setText("");
            }
        }
        else if (charName.getText().length() <=3 ||
                charName.getText().length() > 15){ // Name has invalid length
                gameDialog = new Dialog("Name length is between 4-15 characters."
                    + "Please re-enter");
            if (confirmName != true){
                gameDialog.showErrorMsg(); // Shows error message
                charName.setText("");
            }
        }
        else {
            charName.setForeground(Color.blue); // Show name is accepted
            playerName = charName.getText();
            charName.setText("Name Accepted");
            charName.setEditable(false);
            confirmName = true;
        }

        if (charType.getText().equalsIgnoreCase("Warrior") ||
           charType.getText().equalsIgnoreCase("Marksman") ||
           charType.getText().equalsIgnoreCase("Spellcaster")){
            playerType = charType.getText();
            charType.setForeground(Color.blue);
            confirmType = true; // Shows type is accepted
        }
        else {
            gameDialog = new Dialog("Please select a character type");
            gameDialog.showErrorMsg(); // Type is left blank
            if (confirmType != true){
                confirmType = false;
            }
        }
    }