Skip to main content

Advance Java Login Form


Advance Java Login Form, 

java login form using jframe  






import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Color;


public class Login extends JFrame
{


public Login()
{
    setTitle("Login Form");
getContentPane().setBackground(Color.pink);
     setSize(300,200);
     setLayout(null);
     setDefaultCloseOperation(EXIT_ON_CLOSE);

   setLocation(400, 200);

       
  JLabel l0=new JLabel("Login Form");
       l0.setBounds(150,10,100,20);
  add(l0);

 JLabel l1=new JLabel("Enter User Name");
 l1.setBounds(30,50,100,20);
 add(l1);

     JTextField textFieldUserName = new JTextField(50);
    textFieldUserName.setBounds(140,50,80,20);
      add(textFieldUserName);


   JLabel l2=new JLabel("Enter Password");
 l2.setBounds(30,90,100,20);
 add(l2);

     JTextField textFieldUserPass = new JTextField(50);
    textFieldUserPass.setBounds(140,90,80,20);
      add(textFieldUserPass);


 JButton b1 = new JButton("sumit");
         b1.setBounds(30,130,70,20);
 add(b1);


  JButton b2 = new JButton("Clear");
         b2.setBounds(140,130,70,20);
 add(b2);
 
   setVisible(true);
 

}


public static void main(String s[])
{
Login obj=new Login();

}

}


















Labels

Show more

Popular posts from this blog

Java Program to Display record using JFrame and Prepaired Statement

Java Program to Display  record using JFrame and Prepaired Statement Java Program to Display  record using JFrame and Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameDisplay extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;      JLabel l1,l2;    String snm; Connection con;  Statement smt;   ResultSet rs; //declaration of control    FrameDisplay(){           JFrame f= new JFrame("Display Demo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(1...

java ms access connectivity

java ms access connectivity java ms access connectivity Step by Step jdbc odbc driver for ms access java database connectivity with ms access 2007 java ms access connectivity steps how to connect java with ms access 2007 database with an example how to connect ms access database in java without dsn how to connect ms access database in java without using dsn Hi Friends in this article i am using ms access 2007 database as a back end, using java simple code we will connect to emp database created in ms access , after connecting with emp we are going to perform operation like display records from emp using java simple code, add record to emp using java simple code, delete record from emp using java simple code , update /edit emp using java simple code , i am using simple because vary basic code you found here . follow steps you can watch video or download PDF very Soon  for this article .  First  Create Table  use MS ACCESS 2007 or later as shown in imag...

java MS ACCESS insert,update delete using PreparedStatement

java program delete record from table using  PreparedStatement java MS ACCESS  insert,update  delete using  PreparedStatement import java.sql.*; class DeletePreparest {   public static void main(String s[])   {     try {   int cno=Integer.parseInt(s[0]);  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); // Statement smt=con.createStatement();  PreparedStatement psmt=con.prepareStatement("delete from demo where id=?");  psmt.setInt(1,cno);  int result=psmt.executeUpdate();       System.out.println("record deleted"+result);  con.close(); } catch(Exception e){    System.out.println("exce"+e);}         } }