
July 31st, 2007, 04:59 PM
|
|
Contributing User
|
|
Join Date: Nov 2005
Posts: 91
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 3
|
|
|
Verify text
is there any way to ensure the user has entered atleast one character in a textfield ?
Code:
FnameField.setInputVerifier(new Verify());
class Verify extends InputVerifier
{
public boolean verify(JComponent input)
{
JFormattedTextField tf = (JFormattedTextField) input;
return "sometext".equals(tf.getText());
}
}
is there anyway to modify this from ensuring "sometext" is entered to any character ?
|