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
INTRODUCTION TO PYTHON
INTRODUCTION TO PYTHON Welcome! Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum and first released in 1991. An interpreted language, Python has a design philosophy that emphasizes code readability (notably using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax that allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale. Python features a dynamic type system and automatic memory management and supports multiple programming paradigms, including object-oriented, imperative, functional programming, and procedural styles. It has a large and comprehensive standard library.[26] Python interpreters are available for many operating systems, allowing P...

