import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Bank1 extends JFrame {
private JLabel l1;
private JLabel l2;
private JTextField t1;
private JPasswordField p1;
private JButton b1;
public Bank1()
{
super("Bank System");
Container container = getContentPane();
container.setLayout(new FlowLayout());
l1=new JLabel(" ID :- ");
container.add(l1);
t1=new JTextField(25);
container.add(t1);
l2=new JLabel(" Password :- ");
container.add(l2);
p1=new JPasswordField(25);
container.add(p1);
b1=new JButton("Enter");
container.add(b1);
ButtonHandler handler = new ButtonHandler();
b1.addActionListener(handler);
setSize(400,150);
setVisible(true);
}
public static void main (String args[])
{
Bank1 application = new Bank1();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private class ButtonHandler implements ActionListener{
public void actionPerformed (ActionEvent event)
{
String msg;
msg = "Login Successful";
JOptionPane.showMessageDialog(null,msg);
}
}
}
lo0lo0999 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
mKorbel 274 Veteran Poster
lo0lo0999 0 Newbie Poster
stultuske 1,116 Posting Maven Featured Poster
mKorbel 274 Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.