Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to make a java GUI which is specific for that user after he logins?

Shreyas MishraShreyas Mishra Member Posts: 1

I have created both the Login and Create Account pages and connected them with the SQL database. How do create a GUI which is specific to the user who Logins? I mean that the GUI should appear automatically after Logging in.

try
{
Connection myConn = DriverManager.getConnection(url,user,password);
Statement myStmt = myConn.createStatement();
ResultSet myRs = myStmt.executeQuery("select * from login");
while(myRs.next())
{
if(s1.equals(myRs.getString("usname"))&&s3.equals(myRs.getString("pwd")))
{
System.out.println("Username Found");
System.out.println("Password Found");
JOptionPane.showMessageDialog(null,"Login Successful: "+s1 );
break mainLoop;
}

            }
            JOptionPane.showMessageDialog(null,"Wrong Username/Password");


        }   
        catch(Exception exc)
        {
            exc.printStackTrace();
        }
Sign In or Register to comment.