import javax.swing.JOptionPane; public class InputCheck { //Special words that are not allowed to be inputed by the user private String specialStrings[] = {"category", "objects", "arrows", "relations", "functor", "gml"}; //Special characters that are not allowed to appear anywhere in a user //entered string of text private char specialChars[] = {'*', '#', '.', ',', ' ', ':', '-', '>', '(', ')', '='}; public InputCheck() { // uses default special strings and characters } public InputCheck(String[] specialStrings_, char[] specialChars_) { specialStrings = specialStrings_; specialChars = specialChars_; } public boolean checkStrings(String text) //This method checks the string text to determine if it is the same as any of //strings defined as special strings. It returns true if string is ok and false //if string contains one of the special strings { text = text.toLowerCase(); for (int i=0; i