Email validation Using Swing

please send me source code of "Email validation using swing.
[67 byte] By [Pankua] at [2007-10-3 4:31:17]
# 1
Swing is a GUI framework.Email validation (whatever you precisely mean by that) has nothing to do with GUIs.
itchyscratchya at 2007-7-14 22:34:41 > top of Java-index,Desktop,Core GUI APIs...
# 2

Hi,

i think this code will help u..

public class emailTextField extends JTextField {

final static String badchars

= "`~!#$%^&*()+=\\|\"':;?/><,[]{} ";

int n;

public emailTextField(int n)

{

this.n=n-1;

}

public emailTextField()

{

n=-1;

}

public void processKeyEvent(KeyEvent ev) {

char c = ev.getKeyChar();

if(badchars.indexOf(c) > -1) {

ev.consume();

return;

}

if(n!=-1 &&((getText().length()>n)&&(Character.isLetterOrDigit(c))) )

ev.consume();

else

super.processKeyEvent(ev);

}

}

regards

pradeep

Pradeep_M_Va at 2007-7-14 22:34:41 > top of Java-index,Desktop,Core GUI APIs...