Bounding textField to Numeric or Alphabetic data.....
AOA
How can i bound the JTextField to accept
only numeric data or only alphabetic data
according to my requirement.
I just want that a particular text field
should not take keyboard input other than numeric values.
or it should accept just alphabets in it.
Whats the way to it?
[330 byte] By [
@tifa] at [2007-11-26 16:03:45]

> AOA
> How can i bound the JTextField to accept
> only numeric data or only alphabetic data
> according to my requirement.
> I just want that a particular text field
> should not take keyboard input other than numeric
> values.
> or it should accept just alphabets in it.
> Whats the way to it?
You can't do this with JTextField
Use JFormattedTextField
JFormattedTextField text1=new JFormattedTextField(new DecimalFormat(String Pattern));