to creating a registration form

to creating a registration form

how to create a registration form

View Answers

September 15, 2011 at 12:40 PM

import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;
class RegistrationForm extends JFrame{
JTextField text1,text2,text3,text4,text5;
JPasswordField pass1;
JLabel label1,label2,label3,label4,label5,label6;
JPanel panel;
JButton button;
RegistrationForm() {
text1=new JTextField(15);
text2=new JTextField(15);
text3=new JTextField(15);
pass1=new JPasswordField(15);
text4=new JTextField(15);
text5=new JTextField(15);
label1=new JLabel("First Name");
label2=new JLabel("Last Name");
label3=new JLabel("User Name");
label4=new JLabel("Password");
label5=new JLabel("Address");
label6=new JLabel("Phone No");
button=new JButton("Save");
panel=new JPanel(new GridLayout(7,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(label3);
panel.add(text3);
panel.add(label4);
panel.add(pass1);
panel.add(label5);
panel.add(text4);
panel.add(label6);
panel.add(text5);
panel.add(button);

button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
String value1=text1.getText();
String value2=text2.getText();
String value3=text3.getText();
String value4=pass1.getText();
String value5=text4.getText();
String value6=text5.getText();

Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "test";
String driver = "com.mysql.jdbc.Driver";
String user = "root";
String pass = "root";
String user1="";
String pass1="";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db, user, pass);
Statement st = con.createStatement();
ResultSet rs=st.executeQuery("Select * from login where username='"+value3+"'");
String usern="";
if(rs.next()){
usern=rs.getString("username");
JOptionPane.showMessageDialog(null,"Invalid UserName");
}
else {

int k=st.executeUpdate("insert into login(firstname,lastname,username,password,address,contactno) values('"+value1+"','"+value2+"','"+value3+"','"+value4+"','"+value5+"','"+value6+"')");
JOptionPane.showMessageDialog(null,"Data is successfully saved");
}

}
catch(Exception e){}
}
});
add(panel);
setSize(300,400);
setVisible(true);
}
}

September 15, 2011 at 12:42 PM

import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;
class RegistrationForm extends JFrame{
JTextField text1,text2,text3,text4,text5;
JPasswordField pass1;
JLabel label1,label2,label3,label4,label5,label6;
JPanel panel;
JButton button;
RegistrationForm() {
text1=new JTextField(15);
text2=new JTextField(15);
text3=new JTextField(15);
pass1=new JPasswordField(15);
text4=new JTextField(15);
text5=new JTextField(15);
label1=new JLabel("First Name");
label2=new JLabel("Last Name");
label3=new JLabel("User Name");
label4=new JLabel("Password");
label5=new JLabel("Address");
label6=new JLabel("Phone No");
button=new JButton("Save");
panel=new JPanel(new GridLayout(7,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(label3);
panel.add(text3);
panel.add(label4);
panel.add(pass1);
panel.add(label5);
panel.add(text4);
panel.add(label6);
panel.add(text5);
panel.add(button);

button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
String value1=text1.getText();
String value2=text2.getText();
String value3=text3.getText();
String value4=pass1.getText();
String value5=text4.getText();
String value6=text5.getText();

Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "test";
String driver = "com.mysql.jdbc.Driver";
String user = "root";
String pass = "root";
String user1="";
String pass1="";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db, user, pass);
Statement st = con.createStatement();

int k=st.executeUpdate("insert into login(firstname,lastname,username,password,address,contactno) values('"+value1+"','"+value2+"','"+value3+"','"+value4+"','"+value5+"','"+value6+"')");
JOptionPane.showMessageDialog(null,"Data is successfully saved");
}
catch(Exception e){}
}
});
add(panel);
setSize(300,400);
setVisible(true);
}
}









Related Tutorials/Questions & Answers:
to creating a registration form
to creating a registration form  how to create a registration form
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
Advertisements
Registration Form
Registration Form  Hi Friends I am Working on a small project.I have to create a Registration page using MVC pattern where i have to insert data username,password,date of birth,Mobile number number into database. How to insert
registration form
registration form  Hii.. I have to design one registration page in java that looks like REGISTER USERNAME (here i have to check whether... style="margin-top : 100px" align="center" border=0> <form
Registration Form in HTML
Registration Form in HTML  User Registration Form in HTML - i wanted to design a user registration form in HTML. So, Can anyone please guide me or give me a peace of code to design a user registration form in HTML. Thanks
Login form and registration
Login form and registration  I need a complete code for ligin and new user registration form and validation
popup registration form
popup registration form  hi i want a code for popup registration form.when user click a button popup form will appear.thanks.
form registration on JavaScript
form registration on JavaScript   i want form of registration on JavaScript > < check the name is string or number & if the name number output error >> and the same of email and birthday and country >> <
JSP code for registration form
JSP code for registration form  Haiiii can u please tell me how to encrypt password field in registration form and to compare both password and confirm password fields using jsp
AJAX REGISTRATION FORM
AJAX REGISTRATION FORM  I have implemented user name, check and state selection using ajax, in the html registration form. I am loading two XML... either username or state. How to implement both in same registration form could any
Dynamically creating a form in gwt?
Dynamically creating a form in gwt?  how can i create a gwt form by retrieving fields dynamically from a map? i have all the fields set in the data... fields in a map and creating a form with them
to create registration form
to create registration form  hello friends,im student and i want to do an assignment on to create an registration form with 20 input fields by using...://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml
user Registration form using bean
user Registration form using bean   In this code,password and confirm password does n't matches.Every time an error occured if i entered same string for both.Please help to sort my problem
web page for form registration to my department
web page for form registration to my department  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives
how to create a user registration form in php
how to create a user registration form in php  how to create a user registration form in php
registration form using oop concept
registration form using oop concept  I would like to write a program student registration form at kindergartens and display the information... the output?   Registration Form: import javax.swing.*; import java.awt.
How do I compile the registration form?
How do I compile the registration form?  How do I compile the registration form as stated at the bottom of the following page (URL is below). Do I...://www.roseindia.net/struts/hibernate-spring/user-registration-action.shtml
database spring registration form
database spring registration form We are going to discuss about  database spring registration form. We have created simple spring registration form... registration form. We have used controller and we are using database
creating a feedback form - JSP-Servlet
i am refining this problem as follows: i am creating a feedback form of a college. this feedback form will ask some question. now depending upon those...creating a feedback form  hi, first of all thank you very much
HTML Code for registration form
HTML Code for registration form Here is an example of Registration form using... to register on their website. The registration form is presented to the user where the website input their details and submits the form. Registration form
Developing User Registration Form
Developing User Registration Form   ... necessary to develop the User Registration Form for our Struts, Hibernate and Spring... how to develop the User Registration Form and related JSP files. This User
Need some help creating an order form.
Need some help creating an order form.  Hi there. I am looking to create an order form for clients to customize the way a product looks. The codes I found on the form html page are useful. My question is: can I tie them all
html code for student registration form
html code for student registration form Here is an example of html code for student registration form. In this example, we have displayed many text fields... in student registration form. If you will not enter value in text field than an error
userregistration code -- http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml
userregistration code -- http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml  While running this application on netbeans7.0 , i am getting the following error: message /userregister/ description The requested
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access database by using jsp code.i want to urgent jsp code. please urgent sir. thank
User Registration Form Using JSP(JspBeans)
User Registration Form Using JSP(JspBeans)  ... of user registration form using jsp. One of the basic programming tactics... Step 1: Create a simple registration form (register.html):      
How to Create Login/ Registration Form using PHP and MYSQL
How to Create Login/ Registration Form using PHP and MYSQL  Hi, I am learning PHP. I have some dilemma how to create a Login Form and make connectivity with HTML page using PHP and MYSQL. Is there any body can guide me
How to Create Student Registration Form with HTML Code?
How to Create Student Registration Form with HTML Code? At present, the concept of online student registration form has emerged as a great relief... will learn to create a student registration form using html code in easy steps
User Registration Form Using JSP(JspBeans) after that how i can insert in database
User Registration Form Using JSP(JspBeans) after that how i can insert in database   User Registration Form Using JSP(JspBeans) after that how i can insert in database
put image on form creating in swing-swing code - Swing AWT
put image on form creating in swing-swing code  i want to display image on swing panel and get the image co ordinate by mouse clicking.and also zoom the image at particular area of image. please give solution on my email id
login and registration form using servlet and authentication through mysql
login and registration form using servlet and authentication through mysql  i made a simple login and rgistration form using servlet... help here is my code...plz chk the web.xml file also index.jsp(login form) <
How to insert data into databse by JSP form registration page in netbeans
How to insert data into databse by JSP form registration page in netbeans  ... a student. I have been given a task to create registration page with username & password, & after submitting this form it automatically stores data
Develop user registration form
User Registration Form in JSP     ... registration form which will insert  the entered  data into the database... will be inserted  into the database. Firstly the registration form
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
Creating Canvas Form Example
Creating Canvas Form Example       This example shows that how to use the Canvas Class in a Form. In this example we take two field in which integer number passed from the form
How to send from netbeans gui registration form to MySQL query browser database?
How to send from netbeans gui registration form to MySQL query browser database?  Well i have a Registration form GUI in my netbeans. in my GUI... Registration form GUI. public class Register extends javax.swing.JFrame { public
How to send from netbeans gui registration form to MySQL query browser database?
How to send from netbeans gui registration form to MySQL query browser database?  Well i have a Registration form GUI in my netbeans. in my GUI... Registration form GUI. public class Register extends javax.swing.JFrame { public
registration application
registration application  How to develop a registration application in struts which has seperate file for database connection and data checking and form and action
How to create form in Swings
How to create form in Swings  How to create registration, login and question form in Java Swing?   Creating different forms in Java Swing - Examples how to create registration form in swing swing login form example
user registration
user registration  hi frnds...am working on a project in JSP.i want to create a user registration form with username,password,mail id and check box option for community selection.once the details are registered i want to save
Registration - Ajax
;hi friend, registration form in jsp function checkEmail(email...; } User registration form...Registration  i want to create a registration page. in which User
form
form   Can I prevent a form from being submitted again
course registration
course registration  project for course registration system in java programming
Creating Views
Creating Views Struts provides their own JSP tag library for creating view...; <s:form action="loginSuccess"> <s:textfield name="...; The action is the action in the form tag is the struts action. The form sends
How to handle a form in JSP
JSP code which used the HTML code for creating a form and this form is handled... How to handle a form in JSP       This section teaches you about the creating a from
REGISTRATION OF MBEAN
REGISTRATION OF MBEAN  my question is... i have installed jboss, and created a managed Bean(MBEAN)and provided interface and everything. but i dont know whether the service registerd in jmx or not. please suggest me
database connectivity in jsp form
database connectivity in jsp form We are going to create jsp registration form database. We first create simple registration form. All data ... in this form. We can insert, update, delete any data in this form
Creating Volume Bar Using Gauge Class
Creating Volume Bar Using Gauge Class       This example is all about creating a volume bar using Gauge class. We are creating the object of Gauge class that contains
ModuleNotFoundError: No module named 'registration'
ModuleNotFoundError: No module named 'registration'  Hi, My Python... 'registration' How to remove the ModuleNotFoundError: No module named 'registration' error? Thanks   Hi, In your python

Ads