Results 1 to 2 of 2
  1. #1
    javanew is offline Member
    Join Date
    Mar 2010
    Posts
    49
    Rep Power
    0

    Default Reading strings from the user but dont want to accept numbers ,!

    How to make this ,,
    Reading strings from the user but dont want to accept numbers ,!


    JTextArea area = new JTextArea(30,30);
    String string = area.getText();

    now ^^ i read the string,, but dont want to the user to insert any numbers,, how to make this ??:confused:

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,616
    Rep Power
    25

    Default

    Look at using the JTextField's input verifier.
    Basically you create an InputVerifier and set the textfield to use it. The verifier can control what gets to the textfield's document. See the Tutorial or search here for code samples.

Similar Threads

  1. How to accept operator from user in jdbc ?
    By senidaljeet in forum JDBC
    Replies: 5
    Last Post: 05-13-2010, 09:59 AM
  2. Sorting printed ArrayList of user inputted strings.
    By movsesinator in forum New To Java
    Replies: 3
    Last Post: 04-03-2010, 10:27 PM
  3. While loop comparing strings from user
    By N3VRMND in forum New To Java
    Replies: 5
    Last Post: 10-30-2009, 09:18 AM
  4. How to make a text field to accept numbers only?
    By Robert_85 in forum Advanced Java
    Replies: 15
    Last Post: 04-07-2009, 02:30 PM
  5. Reading in strings
    By thekermo in forum New To Java
    Replies: 2
    Last Post: 10-19-2008, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •