Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners login page validation

Have Programming Question? Ask it here!
 
 
 


mazeed
login page validation
1 Answer(s)      2 years and 11 months ago
Posted in : Java Beginners


hi

could you please send me code for login validations Email validation and password email should be in correct format and valid password in java


Advertisement
View Answers

August 30, 2011 at 11:00 AM


import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.text.*;
import java.util.regex.*;
class Validations extends JFrame{
JLabel l1,l2;
JLabel lab1,lab2;
JTextField t1;
JPasswordField t2;
JPanel p;

Validations(){
l1=new JLabel("Enter Email:");
t1=new JTextField(20);
l2=new JLabel("Enter Password: ");
t2=new JPasswordField(20);
lab1=new JLabel();
lab2=new JLabel();
p=new JPanel(new GridLayout(2,3));
p.add(l1);
p.add(t1);
p.add(lab1);
p.add(l2);
p.add(t2);
p.add(lab2);
add(p);
setVisible(true);
pack();
lab1.setVisible(false);
lab2.setVisible(false);
t1.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
String email=t1.getText();
String exp="^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
CharSequence seq = email;
Pattern pattern = Pattern.compile(exp,Pattern.CASE_INSENSITIVE);
Matcher m = pattern.matcher(seq);
if (m.matches()) {
lab1.setVisible(false);
}
else {
lab1.setText("*Invalid Email ID");
lab1.setVisible(true);
lab1.setForeground(Color.red);
}
}
});

t2.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
String input = t2.getText();

      if((input.length())==0){
         lab2.setVisible(true);
            lab2.setText("Enter Password!");
            lab2.setForeground(Color.red);
      }
      else{
          lab2.setVisible(false);
      }
    }
});


}
public static void main(String[]args){
Validations v=new Validations();
}
}


Related Tutorials/Questions & Answers:
Login page validation on ipad
Login page validation on ipad  I am using userId & password labels and their corresponding textfield. Now I want to validate the details by single sign in button and want to switch on to next page. Used two labels again
login page validation
login page validation  hi could you please send me code for login validations Email validation and password email should be in correct format and valid password in java   import java.awt.*; import javax.swing.
Advertisements
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I got Login By this code i want to login by validating with combobox....The link which you send its without combobox.i m unable to get login by verifying with combo box..Ex banglore
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am....... Thanks alot Index.jsp <%@ page language="java" contentType="text.../html; charset=UTF-8"> <title>Celcabs Login Page</title> <
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am....... Thanks alot Index.jsp <%@ page language="java" contentType="text.../html; charset=UTF-8"> <title>Celcabs Login Page</title> <
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one... page..."); log.info("Login page loaded successfully."); return...="com.credentek.recon.sms.action.IndexAction" method="login"> <
login page
login page  code for login page
Login page
Login page  how to create Login page in java
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
Login validation doubt
Login validation doubt  Hi, 1)login.jsp: <%@page import...;% } %> 2)check.jsp: <%@page import="java.sql.*"%> <% String user...(); ResultSet rs=st.executeQuery("select * from login where uname='"+user
login page
login page  pls say how to create a login page in jsp and mysql using netbaens   Hi Friend, Please visit the following links: http://roseindia.net/jsf/netbeans/index.shtml http://roseindia.net/jsp/loginbean.shtml
login page
login page  How to login as different user in php
login page
login page  hi i'm trying to create login page using jsp. i get... the program. Following are my programs... 1.index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page
login form validation - JSP-Servlet
login form validation  hi, how to validate the login form that contains user name and password using post method . the validation should not allow user to login in the address bar thanks regards, anand
LOGIN PAGE
LOGIN PAGE  A java program with "login" as title,menus added, and a text field asking for firstname, lastname, and displaying current date and time
Login Password Validation iPhone / iPAD
Login Password Validation iPhone / iPAD  HOW TO WRITE A TEST CASE TO SET THE VALIDATION FOR LOGIN AND PASSWORD FIELD IN OBJECTIVE C, IOS.   @implementation LoginViewTests - (void)testPasswordFieldIsNotEmpty
coding for login page
coding for login page  coding for login page
HTML Login Page Code
JavaScript validation in Login page. We have set username and password value.... HTML Login page with JavaScript Validation <html> <body> <...HTML Login Page Code Here is an example of html login page code
login page in php
login page in php  How to create a login page in php
struts2.2.1 Login validation example.
struts2.2.1 Login validation example. In this example, We will discuss about the Login validation using struts2.2.1. Directory structure of example...; charset=UTF-8"> <title>Login Validation Example<
Example of login form validation in struts2.2.1framework.
Example of login form validation in struts2.2.1 framework. In this example, we will introduce you to about the login form validation in struts2.2.1 framework. Our login form validation example does not validate the user against
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
html login page with ajax
html login page with ajax  hi all... i want to create a login page using html and ajax for validation is must. please help me doing that with code...=="yes"){ alert("Welcome User"); }else{ alert("Invalid Login! Please try again
SSL for login page
SSL for login page  I am trying to apply ssl cert to login page only. Does anyone know how to do this on a tomcat web server
jsp login page
jsp login page  hi tell me how to create a login page using jsp and servlet and not using bean... please tell how to create a database in sql server... please tell with code
HTML login page code
HTML login page code  Hi all, I am writing my first HTML JavaScrip validation page called "UserLogin.html". So, please guide me how to validate user... the complete HTML JavaScript code for User Login Page. Thanks in Advance!   
login page error
login page error  How to configure in to config.xml .iam takin to one login form in that form action="/login" .when iam deployee the project... this request." please suggest me.   if your login page is prepared
Registration page with JavaScript Validation
Registration page with JavaScript Validation   HTML Registration page with JavaScript Validation - required source code   Registration page in HTML with JavaScript Validation source code <html> <head>
JSP LOGIN Page
JSP LOGIN Page  sir....i have two user types usercategory and user and both user have userid and password in two different table and now i am making login page for which i have to retrieve usertype,userid and password from two
login page - Java Beginners
login page  I have one login page in jsp that is login.jsp. Now i have validate user from database by another page validate.jsp. but if the user feeded wrong information then i want to print error massege on the first page
login page with image
login page with image  I am writing program for login page.It consists of a image and the login details... how to write a java program using frames that have the default positions in any of the systems.. thanks   i had
Spring Login Page Error
Spring Login Page Error  Dear Sir/Madam, I used the spring login page code. The index page is working fine. When i try to entry login and password , i am getting the below error: Please help me out in this. Let me know if i
jsp login page
jsp login page  Hi All, can any one tell me how to create Login page using JSP and Beans. A simple log in page. Please reply ASAP. Thanx, am2085   Hello Friend, Please visit the following link: JSP Login Using
JSP Login Page Question
JSP Login Page Question  hey..i have a login page where different users first registered and then after they can login. my question is how a user can see only his data after login where different users data are stored
login page php mysql example
login page php mysql example  How to create a login page for user in PHP Mysql? Please provide me a complete tutorial. Thanks in Advance
login page with mysql using jsp
login page with mysql using jsp  pls i need a sample of login page to check username and password in mysql database. thanks
validation web page
validation web page  vivek i want to crate a webpage with specfic email id and password to that webpage . using jsp & servlets   Hi Friend, Try the following code: <html> <script> function checkMail
.Net and SQl 2000 Login page
.Net and SQl 2000 Login page  Please help me creating a login page using dot net using data base sql 2000
login for different user in the same page
login for different user in the same page  how can i do the login for different user in the same page throug jsp
how to create a login page and registration page?
how to create a login page and registration page?  hellow, pls tell me the code for how we can create a login page and registration page and how we can store the info in database.only in advance java as jsp
jsf login page - Java Server Faces Questions
jsf login page  how to create a login page and connect to database using abatis tool
program code for login page in struts by using eclipse
program code for login page in struts by using eclipse  I want program code for login page in struts by using eclipse
click on back button go to the login page
click on back button go to the login page  now when i click on back button the page show that page on where i came from and it shows the session expired but i want when i click a back buttob then it should show a login page
login page using jsp servlrt with mysql database?
login page using jsp servlrt with mysql database?  Description... table login. After successfully login user1 see only index page,if user2 login then he see only visiter page and so on. please gine me any suggession. Thanks
Redirect to same jsp page on successful login
Redirect to same jsp page on successful login  Hi, I have an application where on successful login, the redirect should happen to same page... from the database. I am unable to create the session for the same login page
verfication of user login and then redirecting it to user defined page
verfication of user login and then redirecting it to user defined page  hi, i have a login page that..calls the servlet..and i have used redirect... page.. after i press the submit button..in the login page, i am getting
code for user registration page and login page of emails using jsp
code for user registration page and login page of emails using jsp  hiiiiiii please send me the code for user registration page and login page of email using jsp and servlets and also code for database connectivity to oracle
login
login  login page display an error showing failure to login even when the correct information is entered
admin login control page - JSP-Servlet
admin login control page  how to encrypted password by using jsp... Password Example CodeadminPage.jsp<html> <title>Admin login...>Admin login Page</H1> <form method="POST" action
how to connect jsp with sql database by netbeans in a login page?
how to connect jsp with sql database by netbeans in a login page?  how to connect jsp with sql database by netbeans in a login page
 

 

 

DMCA.com