CODE ONLINE PLEASE VISIT ANY OF THE FOLLOWING....

Simple Login Page

Simple Login Page

      


      

package login;

/**
 *
 * @author NETWEBLOKAM
 */
import javax.swing.*;
import java.awt.event.*;
class Login extends JFrame implements ActionListener
{

JLabel l1,l2,l3,l4;
JButton b;
JPasswordField p;
JTextField t;
Login()
{
l1=new JLabel("USERNAME");
l1.setBounds(20,100,80,30);
add(l1);

t=new JTextField();
t.setBounds(110,100,100,30);
add(t);

l2=new JLabel("PASSWORD");
l2.setBounds(20,150,80,30);
add(l2);


p=new JPasswordField();
p.setBounds(110,150,100,30);
add(p);

Icon image=new ImageIcon("C:\\Users\\Netweblokam\\Documents\\NetBeansProjects\\Netweblokam\\src\\netweblokam/submit.png");

//Enter appropriate location......Image can download from here...

b=new JButton("SUBMIT",image);
b.setBounds(0x6e,200,100,30);
b.addActionListener(this);
add(b);


l3=new JLabel("Please Enter Your Username and Password");
l3.setBounds(20,50,450,30);
add(l3);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(null);
setSize(500,300);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b)
  {
   l3.setText("Welcome "+t.getText()+" Your Password is "+new String(p.getPassword()));
}}
public static void main(String args[])
{
  new Login();
}
}

Output
      


     





Popular posts from this blog

INTRODUCTION TO PYTHON

Fibonacci series by using c

TO FIND ODD NUMBERS UP TO N