abt proj

abt proj

I made login page, when i click on login button , thaen how to go on home page on home page containe some tab like add, delete, update,etc.
plz help
thanx
View Answers

February 3, 2010 at 12:44 PM

Hi Friend,

Try the following:
1)LoginDemo.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
class LoginDemo extends JFrame{
JButton SUBMIT;
JPanel panel;
JLabel label1,label2;
final JTextField text1;
final JPasswordField text2;
LoginDemo(){
label1 = new JLabel();
label1.setText("UserName:");
text1 = new JTextField(15);
label2 = new JLabel();
label2.setText("Password:");
text2 = new JPasswordField(15);
SUBMIT=new JButton("Login");
panel=new JPanel(new GridLayout(4,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(SUBMIT);
add(panel,BorderLayout.CENTER);
SUBMIT.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
String value1=text1.getText();
String value2=text2.getText();
String user1="";
String pass1="";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test";, "root", "root");
Statement st = con.createStatement();
ResultSet res = st.executeQuery("SELECT * FROM login where username='"+value1+"' && password='"+value2+"'");
while (res.next()) {
user1 = res.getString("username");
pass1 = res.getString("password");
}
if (value1.equals(user1) && value2.equals(pass1)) {
HomePage page=new HomePage();
page.setVisible(true);

}
else{
JOptionPane.showMessageDialog(null,"Incorrect login or password","Error",JOptionPane.ERROR_MESSAGE);
}
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
});
}
public static void main(String arg[]) {
LoginDemo frame=new LoginDemo();
frame.pack();
frame.setVisible(true);
}
}

February 3, 2010 at 12:45 PM

continue...

2)HomePage.java:

import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;

class HomePage extends JFrame{
JPanel p1,p2,p3;
JTabbedPane tp;


HomePage(){
p1=new JPanel(new GridLayout(5,2));
p2=new JPanel(new GridLayout(5,2));
p3=new JPanel(new GridLayout(2,2));
tp=new JTabbedPane();
tp.addTab("Add Record",p1);
tp.addTab("Edit Record",p2);
tp.addTab("Delete Record",p3);
add(tp);
setSize(300,150);
setVisible(true);
}
public static void main(String z[]){
HomePage pro=new HomePage();
}
}

For more information, visit the following link:

http://www.roseindia.net/java/example/java/swing/add_edit_and_delete_employee_inf.shtml

Thanks









Related Tutorials/Questions & Answers:
abt proj - Java Beginners
abt proj  if we have already make login page and resister page, if i click on the login button we go to the home page ,home page contain some data plz help
abt proj - Java Beginners
abt proj  which topic i have to study carefully ,when I am going to start java project using swings  Hi Friend, Learn awt, swing containers, components, Events etc. For more information,visit the following links
Advertisements
abt proj - Java Beginners
abt proj  I made login page, when i click on login button , thaen how to go on home page on home page containe some tab like add, delete, update,etc. plz help thanx  Hi Friend, Try the following: 1)LoginDemo.java
ModuleNotFoundError: No module named 'abt'
ModuleNotFoundError: No module named 'abt'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'abt' How to remove the ModuleNotFoundError: No module named 'abt' error
ModuleNotFoundError: No module named 'proj'
ModuleNotFoundError: No module named 'proj'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'proj' How to remove the ModuleNotFoundError: No module named 'proj' error
abt the bank application
abt the bank application  pls can u send to me the user table and transaction table sql statement with their datatype used in this bank application to my email
Version of com.slamdata>abt-core_2.11 dependency
List of Version of com.slamdata>abt-core_2.11 dependency
Version of com.slamdata>abt-core_2.12 dependency
List of Version of com.slamdata>abt-core_2.12 dependency
abt java project - Java Beginners
abt java project  if we want to create a pannel on the button how to write on the code in side the button plz help
ModuleNotFoundError: No module named 'alp-proj'
ModuleNotFoundError: No module named 'alp-proj'  Hi, My Python...-proj' How to remove the ModuleNotFoundError: No module named 'alp-proj... to install padas library. You can install alp-proj python with following
ModuleNotFoundError: No module named 'alp-proj'
ModuleNotFoundError: No module named 'alp-proj'  Hi, My Python...-proj' How to remove the ModuleNotFoundError: No module named 'alp-proj... to install padas library. You can install alp-proj python with following
ModuleNotFoundError: No module named 'bong-proj'
ModuleNotFoundError: No module named 'bong-proj'  Hi, My Python... 'bong-proj' How to remove the ModuleNotFoundError: No module named 'bong-proj' error? Thanks   Hi, In your python environment you
abt java - Java Beginners
abt java   hiiiii i m new to this language i have some problem with my java code ... i working on netbeans .. i write a code for user authetication ... in this code it take user name password and a user certificate(which
abt java project - Java Beginners
abt java project  I don't know too much about java , and I am working on java project, where editor is eclipse and backend postgresql How can i take help about my project, which book I should refers plz help me
abt java project - Java Beginners
abt java project  How to make the home page that contain four tabbedPane like additem, deleteitem ,update etc, so plz help me thanx  Hi Friend, Please go through the following link: http://www.roseindia.net
Maven Dependency abt-core_2.11 >> 0.0.2
You should include the dependency code given in this page to add Maven Dependency of com.slamdata >> abt-core_2.11 version0.0.2 in your project
Maven Dependency abt-core_2.11 >> 0.0.3
You should include the dependency code given in this page to add Maven Dependency of com.slamdata >> abt-core_2.11 version0.0.3 in your project
Maven Dependency abt-core_2.12 >> 0.0.2
You should include the dependency code given in this page to add Maven Dependency of com.slamdata >> abt-core_2.12 version0.0.2 in your project
Maven Dependency abt-core_2.12 >> 0.0.3
You should include the dependency code given in this page to add Maven Dependency of com.slamdata >> abt-core_2.12 version0.0.3 in your project
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'  Hi, My... named 'ECSU_Midterm_Proj' How to remove the ModuleNotFoundError: No module named 'ECSU_Midterm_Proj' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'  Hi, My... named 'ECSU_Midterm_Proj' How to remove the ModuleNotFoundError: No module named 'ECSU_Midterm_Proj' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'provision-py-proj'
ModuleNotFoundError: No module named 'provision-py-proj'  Hi, My... named 'provision-py-proj' How to remove the ModuleNotFoundError: No module named 'provision-py-proj' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'py-proj-init'
ModuleNotFoundError: No module named 'py-proj-init'  Hi, My Python... 'py-proj-init' How to remove the ModuleNotFoundError: No module named 'py-proj-init' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'
ModuleNotFoundError: No module named 'ECSU_Midterm_Proj'  Hi, My... named 'ECSU_Midterm_Proj' How to remove the ModuleNotFoundError: No module named 'ECSU_Midterm_Proj' error? Thanks   Hi, In your
abt java project - Java Beginners
abt java project  this program compile sucessfully but data is not store in data base if any thing correction plz do it import java.awt.*; import javax.swing.*; import java.sql.*; import java.awt.event.*; public class
abt jmeter - Java Server Faces Questions
abt jmeter  how to use jmeter for testing the program?   Hi friend, For using jmeter for testing visit to : http://www.roseindia.net/jmeter/ http://www.roseindia.net/jmeter/using-jmeter.shtml Thanks
need to ans abt db - JSP-Servlet
need to ans abt db  helllo can you tell me m just starting to knowing abt servlet and i trying to making e-mail site so can you tell me with the java servlet wht is the backhand database to use to proper with that site
Maven Repository/Dependency: com.slamdata | abt-core_2.12
Maven Repository/Dependency of Group ID com.slamdata and Artifact ID abt-core_2.12. Latest version of com.slamdata:abt-core_2.12 dependencies. # Version Release Date You can read more
Maven Repository/Dependency: com.slamdata | abt-core_2.11
Maven Repository/Dependency of Group ID com.slamdata and Artifact ID abt-core_2.11. Latest version of com.slamdata:abt-core_2.11 dependencies. # Version Release Date 1 0.0.2
absolutely no idea abt a program - Java Beginners
absolutely no idea abt a program  write a program in java/blue to accept a string from the user and arrange it alphabetically wordwise.. example- input--i am a boy. output--a am boy i.   Hi friend, Code
Clustering
Clustering  Plz let me know abt Clustering in Java with an example
java
java  how to set SMS alert in my proj? Pls tel me the procedure
HSQLDB - Java Server Faces Questions
HSQLDB  HSQLDB IS THERE ANYBODY knows abt hsqldb,anybody is thr contact me i want to know
j2me
j2me  COmmand c=new Command("Exit",Command.EXIT,100);Please expalin abt 3 parameters
java - Java Beginners
java  how i can get information abt the installed softwares of an operating system
Menu Bar prob.
Menu Bar prob.  I want a menu to be displayed in each page of my swing appl. how to go abt
Interview question - Java Interview Questions
Interview question   Hi Friends, Give me details abt synchronization in interview point of view. I mean ow to explain short and neat. Thanks
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.289 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.289 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.288 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.288 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.286 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.286 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.287 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.287 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.285 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.285 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.284 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.284 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.283 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.283 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.282 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.282 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.281 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.281 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.280 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.280 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.279 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.279 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.278 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.278 in Maven based Java proj
Maven dependency for org.wso2.carbon.extension.identity.authenticator.outbound.totp - org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.277 is released. Learn to use org.wso2.carbon.extension.identity.authenticator.totp.connector version 2.1.277 in Maven based Java proj

Ads