Simple Login Page
- Get link
- X
- Other Apps
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
FIND NUMBER OF VOWELS IN A STRING
FIND NUMBER OF VOWELS IN A STRING c=raw_input("Enter A String:") b=c.lower() x=0 for letter in b: if letter in "aeiou": x+=1 print "Total Number Of Vowels = " + str(x) print "Number Of Vowels In Each" d,e,f,g,h=0,0,0,0,0 for letter in b: if letter in "a": d+=1 print "a=" +str(d) for letter in b: if letter in "e": e+=1 print "e=" +str(e) for letter in b: if letter in "i": f+=1 print "i=" +str(f) for letter in b: if letter in "o": g+=1 print "o=" +str(g) for letter in b: if letter in "u": h+=1 print "u=" +str(h) OUTPUT
TO FIND EVEN NUMBERS UP TO N
ENTERED NUMBER IS PRIME OR NOT
ENTERED NUMBER IS PRIME OR NOT n=int(input("enter a number:")) if n<0: print "enter a valid input" elif n<2: print "neither prime nor composite" else: for i in range(2,n/2): if(n%i)==0: print n,"is not a prime number" break else: print n,"is a prime number" OUTPUT --------------------------------------------------------------------------------------------------------------------------

