Java Code Examples for org.apache.commons.lang3.StringUtils.isAlpha()

The following are Jave code examples for showing how to use isAlpha() of the org.apache.commons.lang3.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lazycat   File: GUIUtil.java   View Source Code Vote up 7 votes
public static boolean checkAlphaNumeric(JTextField tf, String input) {
	String text = tf.getText().trim();
	if (text.length() == 0)
		return true;

	if (!StringUtils.isAlphanumeric(text)) {
		JOptionPane.showMessageDialog(null, input + "ֻ����Ӣ�ĺ�������ɣ�����ֻ����ӦΪ��ͷ");
		tf.grabFocus();
		return false;
	}
	if (text.length() != 0 && !StringUtils.isAlpha(String.valueOf(text.charAt(0)))) {
		JOptionPane.showMessageDialog(null, input + "ֻ����Ӣ�ĺ�������ɣ�����ֻ��Ӣ�Ŀ�ͷ");
		tf.grabFocus();
		return false;
	}
	return true;

}
 
Example 2
Project: vscrawler   File: IsAlpha.java   View Source Code Vote up 4 votes
@Override
protected  boolean handle(CharSequence str) {
    return StringUtils.isAlpha(str);
}