Application for Username and Password.

Q19. Design a Java NetBeans GUI application for checking Username and  Password.


Create a GUI application as per following screenshot.

Code For Log In

Type the following code by double clicking jButton1, button, below the line that says, ‘// TODO add your handling code here’


String user;


String pwd;

pwd=new String(jPasswordField1.getPassword());

if(user.equals(“CHB”) && pwd.equals(“root”))

JOptionPane.showMessageDialog(null,”Log In Successfull”);


JOptionPane.showMessageDialog(null,”Invalid Username or Password”);




Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: