This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi, i have this code and its works as it takes in a word from the text field and verifies it to see if it is a char but i want it to take eg kelly smith at the same time so the space can also be verified is there a method for this ? that's for the text field to take only letters and space but not numbers i can't find any method or maybe did not know wat to look for in the api's can anyone help? (edited by Cindy to put a meaningful Subject on this topic) [ August 05, 2002: Message edited by: Cindy Glass ]
Dear Khella Smith, I don't know if you are using AWT or Swing. Anyhow, with swing, this particular problem of yours gets easier the higher the version of JDK/SDK you are using.The InputVerifier class was introduced into Swing in JDK1.3 and could save one a lot of lines of code when validating a textfield. The APIs even have an example on it's usage, do check it out. Also JFormattedTextField was introduced in JDK1.4 and even has a more complete set of methods that support validating abitrary values in a JTextField. It wouldn't be a bad idea for you to move up to a later version of the SDK (if you are using an old one, that is), moreso because it's................ free!. Hope this helps.