import [Link].
*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class A
{
static JFrame F3;
static JButton B3,B4,B5,B6;
JFrame F,F1;
JLabel L1,L2,L3,L4;
JTextField T,T1;
JPasswordField P,P1;
JButton B,B1,B2;
ResultSet rs;
Statement st;
A()
{
F= new JFrame("Log In");
F1= new JFrame("Register");
L1= new JLabel("USER NAME");
L2= new JLabel("PASSWORD");
L3= new JLabel("USER NAME");
L4= new JLabel("PASSWORD");
T=new JTextField(10);
T1=new JTextField(10);
P=new JPasswordField(10);
P1=new JPasswordField(10);
B=new JButton("Log In");
B1=new JButton("Sign Up");
B2=new JButton("Register");
[Link](L1);
[Link](T);
[Link](L2);
[Link](P);
[Link](B);
[Link](B1);
[Link](new FlowLayout());
[Link](JFrame.EXIT_ON_CLOSE);
[Link](true);
[Link](200,200);
[Link](L3);
[Link](T1);
[Link](L4);
[Link](P1);
[Link](B2);
[Link](200,200);
[Link](new FlowLayout());
connect();
[Link](new ActionListener(){
public void actionPerformed(ActionEvent ea)
{
[Link](true);
}
}
);
[Link](new ActionListener(){
public void actionPerformed(ActionEvent eb)
{
try
{
String u=[Link]();
String p=new String([Link]());
[Link]("insert into users values('"+u+"','"+p+"')");
[Link](null,[Link]()+" is registered successfully");
}
catch(Exception ez)
{
[Link](ez);
}
}
}
);
[Link](new ActionListener(){
public void actionPerformed(ActionEvent ec)
{
try
{
String u1=[Link]();
String p1=new String([Link]());
String sql="select username,pass from users where username='"+u1+"'and
pass='"+p1+"'";
rs=[Link](sql);
int count=0;
while([Link]())
{
count=count+1;
}
if(count==1)
{
[Link](null,"User Found ! Access Granted");
[Link](true);
}
else if (count>1)
{
[Link](null,"Duplicate Users Found ! Acess Denied !");
}
else
{
[Link](null,"User Not Found ! Check Your Credentials");
}
}
catch(Exception ew)
{
[Link](ew);
}
}
}
);
}
public void connect()
{
try
{
[Link]("[Link]");
Connection c = [Link]("jdbc:mysql://localhost/vishwa","root","100%Lv");
st = [Link]();
}
catch(Exception ex)
{
[Link](ex);
}
}
public static void main(String arg[])
{
new A();
F3=new JFrame("Welcome to JVC");
ImageIcon icon1 = new ImageIcon ("Basic [Link]");
ImageIcon icon2 = new ImageIcon ("[Link]");
ImageIcon icon3 = new ImageIcon ("[Link]");
ImageIcon icon4 = new ImageIcon ("[Link]");
B3= new JButton(icon1);
B4= new JButton(icon2);
B5= new JButton(icon3);
B6= new JButton(icon4);
[Link](B3);
[Link](B4);
[Link](B5);
[Link](B6);
[Link](920,480);
[Link](new FlowLayout());
[Link](new C());
[Link](new C());
[Link](new C());
[Link](new C());
}
static class C implements ActionListener
{
public void actionPerformed(ActionEvent y)
{
if([Link]()==B3)
{
try{
Desktop d=[Link]();
[Link](new URI("[Link]
}
catch(Exception z)
{
[Link](z);
}
}
else if( [Link]()==B4)
{
try{
Desktop d1=[Link]();
[Link](new URI("[Link]
}
catch(Exception z1)
{
[Link](z1);
}
}
else if([Link]()==B5)
{
try{
Desktop d2=[Link]();
[Link](new URI("[Link]
}
catch(Exception z2)
{
[Link](z2);
}
}
else
{
try{
Desktop d3=[Link]();
[Link](new URI("[Link]
}
catch(Exception z3)
{
[Link](z3);
}
}
}
}
}