Skip to content

Commit

Permalink
Password requirements changed to 6 & 1 letter
Browse files Browse the repository at this point in the history
Password now shows as bullets instead of plaintext
You can now use tab in HomeFrame & RegisterFrame
  • Loading branch information
MrThanasiz committed Jun 12, 2019
1 parent a18df38 commit a5ef8b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/HomeFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public class HomeFrame extends JFrame
private static JButton registerButton;
private static JButton infoButton;

private static JTextArea username;
private static JTextArea password;
private static JTextField username;
private static JPasswordField password;

public HomeFrame() {
this.setPanel();
Expand Down Expand Up @@ -151,7 +151,7 @@ public void setUsernameTextPanel() {
usernameFieldPanel = new JPanel();
usernameFieldPanel.setPreferredSize(new Dimension(USERNAME_PANEL_WIDTH , USERNAME_PANEL_HEIGHT));

username = new JTextArea();
username = new JTextField();
username.setPreferredSize(new Dimension(USERNAME_TEXT_AREA_WIDTH, USERNAME_TEXT_AREA_HEIGHT));

usernameFieldPanel.add(username);
Expand All @@ -165,7 +165,7 @@ public void setPasswordTextPanel() {
passwordFieldPanel.setPreferredSize(new Dimension(PASSWORD_PANEL_WIDTH , PASSWORD_PANEL_HEIGHT));


password = new JTextArea();
password = new JPasswordField();

password.setPreferredSize(new Dimension(PASSWORD_TEXT_AREA_WIDTH, PASSWORD_TEXT_AREA_HEIGHT));

Expand Down
10 changes: 5 additions & 5 deletions src/RegisterFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class RegisterFrame extends JFrame implements ActionListener

private static JButton registerButton;

private static JTextArea password;
private static JTextArea id;
private static JPasswordField password;
private static JTextField id;

static String depString = "dai";

Expand Down Expand Up @@ -131,7 +131,7 @@ public void setPasswordTextPanel() {
passwordFieldPanel.setPreferredSize(new Dimension(PASSWORD_PANEL_WIDTH , PASSWORD_PANEL_HEIGHT));


password = new JTextArea();
password = new JPasswordField();

password.setPreferredSize(new Dimension(PASSWORD_TEXT_AREA_WIDTH, PASSWORD_TEXT_AREA_HEIGHT));

Expand All @@ -154,7 +154,7 @@ public void passwordLabelBelow() {
passwordLabelBelowPanel = new JPanel();
passwordLabelBelowPanel.setPreferredSize(new Dimension(MESSAGE_PANEL_WIDTH , MESSAGE_PANEL_HEIGHT));

JLabel labela = new JLabel("Remember , password must contain at least 8 characters , including one lower case and one upper case!");
JLabel labela = new JLabel("Remember , password must be atleast 6 characters long , including one lower case or upper case letter!");

passwordLabelBelowPanel.add(labela);

Expand Down Expand Up @@ -186,7 +186,7 @@ public void setIDTextPanel() {
IDFieldPanel.setPreferredSize(new Dimension(PASSWORD_PANEL_WIDTH , PASSWORD_PANEL_HEIGHT));


id = new JTextArea();
id = new JTextField();

id.setPreferredSize(new Dimension(ID_TEXT_AREA_WIDTH, ID_TEXT_AREA_HEIGHT));

Expand Down
5 changes: 3 additions & 2 deletions src/ValidationCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ public static boolean CheckFailed(String failedS) {
}
public static boolean CheckPassword(String pw) {
String n = ".*[0-9].*";
String a = ".*[A-Z].*";
return pw.matches(n) && pw.matches(a) && pw.length()>=8;
String al = ".*[a-z].*";
String ac = ".*[A-Z].*";
return pw.matches(n) && pw.length()>=6 &&(pw.matches(ac)||pw.matches(al));
}


Expand Down

0 comments on commit a5ef8b4

Please sign in to comment.