Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-19-2007, 10:54 PM
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
Validating email address
I have a textfield on a frame and the user enters his email address in it. I want simple validation for it. I know how to do it using javascript on HTML pages but don't know how to do it on a frame.

Please help me out of this.

Cheers
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-20-2007, 11:40 AM
Member
 
Join Date: Dec 2007
Posts: 3
collins is on a distinguished road
Hi,
You can do the validation in swings same as Javascript using "Regular Expression". In java, you have two classes called "Pattern" and "Matcher". using which you can do this.

Example:-

String str=Regular Expression
String str2="Email Address to be validated"

Pattern p=Pattern.compile(str);
Matcher m=p.matcher(str2);

if(m.find()==true){}
else {}

Post Reply if u have doubts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-21-2007, 10:42 AM
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
Thanks collins. I guess I have to explore regex API because I am not into regular expressions.

Thanks once again.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
send email using JMS Heather Advanced Java 8 Yesterday 04:59 PM
Validating ASCII character set JavaForums Java Blogs 2 09-15-2008 10:44 PM
Validating email address! rameshraj Advanced Java 1 02-18-2008 11:39 AM
validating selection list in struts! rameshraj Web Frameworks 2 02-13-2008 03:21 PM
validating a string for numbers and letters? lockmac New To Java 1 08-09-2007 11:17 AM


All times are GMT +3. The time now is 01:33 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org