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 read file Character by Character

welcome java file handling tutorial . in this tutorial we are going to learn how to read text file using  java here i have used FileReader to  read file Character by Character. use following steps to read text file using java  program 1. create one folder on d drive as f that is name of folder is f 2. create t1.txt file write some text on it 3. create java program use following code or follow steps from video save java program in same folder import java.io.* package properly in java program 4. compile program and run 5. to understand program read what is FileReader read program explanation given below. save RfileCh.java // program by Prakash import java.io.*; class RfileCh {  public static void main(String s[])  {   try{        FileReader r=new FileReader("t1.txt");   // used to open a file   int ch;     while((ch=r.read())!=-1)   // here -1 is end of ...

Java Program to delete record using JFrame and Prepaired Statement

Java Program to delete record using JFrame and Prepaired 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 FrameDelete extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;   JLabel l1,l2; Connection con;    PreparedStatement psmt;   int result; //declaration of control    FrameDelete(){           JFrame f= new JFrame("InsertDemo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(150,50,150,20);   tf3=new JTextField();           tf3.setBounds(1...

jbutton Click Event example Advance Java

Jbutton Click Event example Advance Java  Change frame Color On Button click Advance Java  import javax.swing.*; import java.awt.*; import java.awt.event.*;      class FrameDemo extends JFrame implements ActionListener {       JButton btn; Container c;          FrameDemo() {               c=this.getContentPane();        JButton btn= new JButton("Click"); btn.setBounds(100,50,100,50);         c.add(btn);         c.setLayout(null);        btn.addActionListener(this); }                    public void actionPerformed(ActionEvent a) {                     c.setBackground(Color.RED); } }        // cre...