From 7c04c7cda2fdf143d02924d5a634acff3c8e901c Mon Sep 17 00:00:00 2001 From: Adah Boukhari Date: Sun, 9 Feb 2020 16:01:09 +0100 Subject: [PATCH] Commit_49 JLabel _F5:Exit_ hinzugefuegt --- .../bin/MeinBudgetView/LoginFrame.class | Bin 4572 -> 4685 bytes .../bin/MeinBudgetView/MeinGui.class | Bin 7870 -> 7870 bytes .../bin/MeinBudgetView/MyTest.class | Bin 2362 -> 2362 bytes .../src/MeinBudgetView/LoginFrame.java | 17 +++++++++----- .../src/MeinBudgetView/MeinGui.java | 5 ++--- Budget Projekt/src/MeinBudgetView/MyTest.java | 21 ++++++++---------- Command.txt | 2 +- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Budget Projekt/bin/MeinBudgetView/LoginFrame.class b/Budget Projekt/bin/MeinBudgetView/LoginFrame.class index 0ea254134a57b0fba7f1230bf05b0e4adfeb8ec5..2254de99f30194a8b1ab9dcfd59862e8dab673f3 100644 GIT binary patch delta 1455 zcmaKrdr(w$6vscmUD&&O_aZ9{6kC%h%vgv6jUzQ`IYsL9fCNm&%xcLygahl0?5Nm- zrpD|w)pRvODzQ>~VS;ucNGmNXUu9`8&3u);>}B*Iv(CL2O`56wZuPBDuN9%iw1QQ(5eBArP{D5lxqQ697I z51bch)+wdg+7j44Af>jdw$z++MXbuKz3yCVu~rmXO}j>$B5JMDqR9qpSZnoYLj$%! z2c6cCV9v-cUe@SVL}tWh#|mm=@#=z##H^ZlwZS^pD+0A81(f%wO>Jw(2K@Woz zNuJ({Uk!c}WhR7kGkOjF;0%Q(peLDg#g0;Xt=qyix_>+xLGVS_91VA>#%`ufNqeY+ z*eESa>t_Cxv;|3#a0hqW+?S;dRFem?D^eaAU{jU1mZ4di&1IF6O~|uZ*iM-&kF--M zOH*HUiMM^+`?$1C-iVJDi5n=CIEW;&(HTrCL$G>M?rPjfiP}l2I>?pk2xY2=a&?Rf zpPxy-Fjx7~nC#1?B!{mAxYKI z%Ck~SRu6D5&q*zy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$fdmmH1Z09uEM`W0>r3Kzs=y!9>v6AGiB(*7B_Utk24{8O>hK23 zZESi`PT(W)xi?Zg(X1T)yEIi+I_{P#cC*JRmCCc_@yVn9(baoryIWZ81t-ZUKIRiC zReXA^MV9@NyKXl>5t7+8fFAqWOz_<2Jm! zmnvykwSmY#Fd5L JB*n+?e*?WPMKu5b diff --git a/Budget Projekt/bin/MeinBudgetView/MeinGui.class b/Budget Projekt/bin/MeinBudgetView/MeinGui.class index 1ae2f76327274052b519fe9e6dbda57cf82dbdcc..9f008b2bda6c0c5a3af34d4aead22c869410bd7f 100644 GIT binary patch delta 51 zcmdmIyU%vRd09sJ$rohJ8S5u=$SDabGjKAhFz_&{F^Dp%Ge|IMO}3WvVKe}$ke$3# GP7(lP7z|GU delta 51 zcmdmIyU%vRd09q<$rohJ8GR;m$SDb`FmN)eGVm~}Gl(*3Fi0?JPqvoxVKfA)ke$3# GP7(lIU<@Mw diff --git a/Budget Projekt/bin/MeinBudgetView/MyTest.class b/Budget Projekt/bin/MeinBudgetView/MyTest.class index 23c120bf70f1468e913c2d9c6e1f967958c0539a..d118b035a92158f056e9c266c26709465f4e5887 100644 GIT binary patch delta 65 zcmdlbv`c8iBX&lc$&cCFBpn&J7@QbH7@Qg87+e@M7+e{Q7~Fs&9+R6mY6X26I2imG U1Q`4o)EEL7EE$3(3vg-y0P+nC!~g&Q delta 65 zcmdlbv`c8iBX&l+$&cCFBwZM|7+e`d7~B}-7~B~&7(5t^7(5xA7`!JpanuS1FmNyg VG6*mPF{m*FGgvZ&P8Q(Q0s!`P4C(*? diff --git a/Budget Projekt/src/MeinBudgetView/LoginFrame.java b/Budget Projekt/src/MeinBudgetView/LoginFrame.java index d7bbd9e..231270f 100644 --- a/Budget Projekt/src/MeinBudgetView/LoginFrame.java +++ b/Budget Projekt/src/MeinBudgetView/LoginFrame.java @@ -72,6 +72,11 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { loginHauptImage.setIcon(new ImageIcon(image2)); loginHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13)); contentPane.add(loginHauptImage); + + JLabel lblNewLabel_1 = new JLabel("F5: exit"); + lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 11)); + lblNewLabel_1.setBounds(342, 213, 82, 14); + contentPane.add(lblNewLabel_1); this.anmelden.addActionListener(this); passwordField.addActionListener(this); @@ -97,12 +102,12 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { } - protected static String setBenutzername(String benutzername) { - return benutzername; + protected static String setBenutzername(String benutzername) { + return benutzername; } protected static String setPassword(String password) { - return password; + return password; } @Override @@ -114,7 +119,8 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { - if (benutzername.getText().contentEquals(setBenutzername("admin")) && passwordField.getText().equals(setPassword("admin"))) { + if (benutzername.getText().contentEquals(setBenutzername("admin")) + && passwordField.getText().equals(setPassword("admin"))) { MeinGui run = new MeinGui(); run.setVisible(true); } else { @@ -124,7 +130,7 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { if (e.getKeyCode() == KeyEvent.VK_F5) { System.exit(0); } - if (e.getKeyCode() == KeyEvent.VK_L) { + if (e.getKeyCode() == KeyEvent.VK_DELETE) { benutzername.setText(benutzernameUndPasswordLeeren()); passwordField.setText(benutzernameUndPasswordLeeren()); } @@ -140,5 +146,4 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { public static String benutzernameUndPasswordLeeren() { return ""; } - } diff --git a/Budget Projekt/src/MeinBudgetView/MeinGui.java b/Budget Projekt/src/MeinBudgetView/MeinGui.java index c43e841..ad03c89 100644 --- a/Budget Projekt/src/MeinBudgetView/MeinGui.java +++ b/Budget Projekt/src/MeinBudgetView/MeinGui.java @@ -283,19 +283,18 @@ public class MeinGui extends JFrame implements ActionListener, KeyListener { @Override public void keyTyped(KeyEvent e) { - } @Override public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_L) { + if (e.getKeyCode() == KeyEvent.VK_DELETE) { leeren(); } if (e.getKeyCode() == KeyEvent.VK_F5) { exitButton(); } - + } @Override diff --git a/Budget Projekt/src/MeinBudgetView/MyTest.java b/Budget Projekt/src/MeinBudgetView/MyTest.java index fb3afec..9542243 100644 --- a/Budget Projekt/src/MeinBudgetView/MyTest.java +++ b/Budget Projekt/src/MeinBudgetView/MyTest.java @@ -49,39 +49,36 @@ class MyTest { @Test public void testSetBenutzername() { - + assertEquals("admin", LoginFrame.setBenutzername("admin")); assertEquals("ADMIN", LoginFrame.setBenutzername("ADMIN")); assertNotEquals("Admin", LoginFrame.setBenutzername("")); assertNotEquals("admin", LoginFrame.setBenutzername("Admin")); assertNotEquals("", LoginFrame.setBenutzername("admin")); assertEquals("ADMin".toUpperCase(), LoginFrame.setBenutzername("admin").toUpperCase()); - - - + } - @Test public void testSetPassword() { - + assertEquals("password", LoginFrame.setBenutzername("password")); assertEquals("PassWord", LoginFrame.setBenutzername("PassWord")); assertNotEquals("password", LoginFrame.setBenutzername("")); assertNotEquals("PASSWORD", LoginFrame.setBenutzername("password")); assertNotEquals("", LoginFrame.setBenutzername("password")); assertEquals("PaSSwOrd".toUpperCase(), LoginFrame.setBenutzername("passwoRd").toUpperCase()); - + } - + @Test public void testSetLeeren() { - + assertEquals("", LoginFrame.benutzernameUndPasswordLeeren()); assertNotEquals(" ", LoginFrame.benutzernameUndPasswordLeeren()); - assertNotEquals("".length() > 0 , LoginFrame.benutzernameUndPasswordLeeren()); - assertNotEquals(""==null, LoginFrame.benutzernameUndPasswordLeeren()); - + assertNotEquals("".length() > 0, LoginFrame.benutzernameUndPasswordLeeren()); + assertNotEquals("" == null, LoginFrame.benutzernameUndPasswordLeeren()); + } } diff --git a/Command.txt b/Command.txt index 9602535..079746a 100644 --- a/Command.txt +++ b/Command.txt @@ -3,5 +3,5 @@ Befehle: 1)Benutzername: admin 2)Password: admin -L: Alle Einträge leeren +DELETE_Taste: Alle Einträge leeren F5: Exit