Skip to content

Commit

Permalink
created login class
Browse files Browse the repository at this point in the history
  • Loading branch information
alina-z7 committed Nov 30, 2024
1 parent 467fd29 commit f343251
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions LogIn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import javax.swing.*;

public class LogIn {
public Guest logIn() {
try {UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");}
catch (Exception e) {System.out.println("Look and Feel not set");}

LoginPage loginPage = new LoginPage(null);
Guest guest = loginPage.guest;

if(guest != null) {
System.out.println("<Successful login>\n\t" +
guest.getName() +
"\n\tID: " + guest.id_number +
"\n\tPassword: " + guest.password +
"\n\tStatus: " + guest.guest_status);
}else{
System.out.println("Authentication Cancelled");
}
return guest;
}
}

0 comments on commit f343251

Please sign in to comment.