It is possible to store the mind with a million facts and still be entirely uneducated.
- Alec Bourne
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Java Login
by: suhail
Description:
This code is aimed to help those who are interested in programming with Java. Another file is also interfaced. Compile it using jdk and then this file and run.
Code:
import java.awt.*; import java.awt.event.*; import java.util.*; public class Ques51 extends Frame { static TextField ID= new TextField(); static Label tel= new Label(); static Button Login=new Button("Login"); static Button Quit= new Button("Quit"); Label address= new Label("Enter email address"); static Label name= new Label(); static Label fname= new Label(); // static myHashMap one=new myHashMap("kkc1982@hotmail.com"); static myHashMap two=new myHashMap("aijazdin@hotmail.com"); static myHashMap three=new myHashMap("zulfi@hotmail.com"); // Ques51(){ one.add("kanesh Kumar","teekam","32178"); two.add("Aijaz Ahmed","din ","31185"); three.add("zulfi Memon","sharaffudin","32135"); ID.addActionListener(new ener1()); Login.addActionListener(new ener()); Quit.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ System.exit(0); } } ); addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } } ); setLayout(null); setBounds(100,100,600,400); ID.setBounds(130,30,400,20); name.setBounds(30,70,200,20); fname.setBounds(30,110,200,20); tel.setBounds(30,150,200,20); Login.setBounds(200,230,70,30); Quit.setBounds(300,230,70,30); add(ID); add(name); add(fname); add(tel); add(Login); add(Quit); show(); } public static void main(String[] args) { new Ques51(); } } class ener implements ActionListener{ public void actionPerformed(ActionEvent e){ Button bt1=(Button)e.getSource(); Ques51 q=(Ques51)bt1.getParent(); String id= q.ID.getText(); HashMap b=(HashMap)myHashMap.getDetails(id); q.name.setText("Name: "+b.get("Name").toString()); q.fname.setText("Father's name: "+b.get("Father's name").toString()); q.tel.setText("Phone number: "+b.get("Phone").toString()); } } class ener1 implements ActionListener{ public void actionPerformed(ActionEvent e){ TextField bt1=(TextField)e.getSource(); Ques51 q=(Ques51)bt1.getParent(); String id= q.ID.getText(); HashMap b=(HashMap)myHashMap.getDetails(id); q.name.setText("Name: "+b.get("Name").toString()); q.fname.setText("Father's name: "+b.get("Father's name").toString()); q.tel.setText("Phone number: "+b.get("Phone").toString()); } }
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
16,840
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
Hello World Program
·
chessboard
Your Code Here
"AllSyntax.com" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy