From 2fd5b9bb173d2df5e56fcb16e96ad4e4f47cd961 Mon Sep 17 00:00:00 2001 From: Adah Boukhari Date: Sat, 8 Feb 2020 22:14:44 +0100 Subject: [PATCH] Commit_45 (klicke F5 fuer Exit) KeyListener und Methode benutzernameLeeren() implementiert und getestet --- .../bin/MeinBudgetView/LoginFrame.class | Bin 4251 -> 4382 bytes .../bin/MeinBudgetView/MeinGui.class | Bin 7849 -> 7870 bytes .../bin/MeinBudgetView/MyTest.class | Bin 2171 -> 2479 bytes .../src/MeinBudgetView/LoginFrame.java | 8 ++++++++ .../src/MeinBudgetView/MeinGui.java | 4 ++++ Budget Projekt/src/MeinBudgetView/MyTest.java | 10 ++++++++++ Command.txt | 1 + 7 files changed, 23 insertions(+) diff --git a/Budget Projekt/bin/MeinBudgetView/LoginFrame.class b/Budget Projekt/bin/MeinBudgetView/LoginFrame.class index f936ee6f74ca14a326aed9899c2fae304b54c1de..e2944f3e909aa9625cb52f760206b2fb53c863d9 100644 GIT binary patch delta 316 zcmXYryGjF55Qe{#O-!;0Bt))KQi<^i zbn${H_y87atzzT-@(kj*I>kTCHpcu2c#qQ)tYzF>ov=m2riis&j?sti(Nm^yjZD6q~L4aRA*D^tCH z=V-Ghl^o`ddz9=%xZ+yuZiGfK^0B1gH*Q5c1&x5`q`K6Gx0&iL#ChlVztb=IH;jxv UkQ54j>ImRg;29FC_y~HRKQC-Vi2wiq delta 149 zcmbQIG+UAD)W2Q(7#JAL7@lq9n#0A%$iSVQS{am@lbTqZnlkwVmmeehW_#}SES$3$ zm>8IWDy=7f=eOeB2xKuc%mb2g4D6G=1!Rrq1KA1?6$}d)76N%dwG6iz?l3SiXfm)e poMSi-G~ohJl!bxGkOL_Cc=8efCB~M?#|30L85y1cWtbSA0su7OA`<`r diff --git a/Budget Projekt/bin/MeinBudgetView/MeinGui.class b/Budget Projekt/bin/MeinBudgetView/MeinGui.class index f6f65bc5e5e9e0500e13dce8dbb1219cc08ed5d3..1ae2f76327274052b519fe9e6dbda57cf82dbdcc 100644 GIT binary patch delta 126 zcmZ2!yU%vRPuYxg1|}e6V35?_#@Hj^vw(qZ2crd;T>@sCZUjm)Gs*x-F$Pu!21XSI zPDWJ*9!7NrQAQ002}W&3S+E?~5Jovhc_0sH9AhVA7Xu?>29V9dz{JBn*+))|(Qxtw KS=q@GUPubug1|}e6VBpo>#@Hj^vw(qZ2cyMCpa3(Y43OkwU}j)oRAJy`RAt~{ xRA-b0iitrqFv>B?19?ELjGc^K42+B!KsGZ2BhTbSIW+2!2gQdn%UANNmgQkb@w-oYN?dr1*BmzV!7^pa#0GA-PvQ0(`s7O^ delta 36 scmZ24{9AzQ)W2Q(7#JAL7^*jN>99^d$Ew1}w)r!wG&3s$0~13P0PeyHkN^Mx diff --git a/Budget Projekt/src/MeinBudgetView/LoginFrame.java b/Budget Projekt/src/MeinBudgetView/LoginFrame.java index 017aa30..8b973fb 100644 --- a/Budget Projekt/src/MeinBudgetView/LoginFrame.java +++ b/Budget Projekt/src/MeinBudgetView/LoginFrame.java @@ -123,6 +123,10 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { JOptionPane.showMessageDialog(this.anmelden, "Bitte geben Sie die richtigen Daten ein!"); } } + if (e.getKeyCode() == KeyEvent.VK_F5) { + System.exit(0); + } + } @Override @@ -130,4 +134,8 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { // TODO Auto-generated method stub } + + public static String benutzernameLeeren() { + return ""; + } } diff --git a/Budget Projekt/src/MeinBudgetView/MeinGui.java b/Budget Projekt/src/MeinBudgetView/MeinGui.java index 127f04b..c43e841 100644 --- a/Budget Projekt/src/MeinBudgetView/MeinGui.java +++ b/Budget Projekt/src/MeinBudgetView/MeinGui.java @@ -292,6 +292,10 @@ public class MeinGui extends JFrame implements ActionListener, KeyListener { if (e.getKeyCode() == KeyEvent.VK_L) { 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 a4a5e72..54817c2 100644 --- a/Budget Projekt/src/MeinBudgetView/MyTest.java +++ b/Budget Projekt/src/MeinBudgetView/MyTest.java @@ -63,5 +63,15 @@ class MyTest { assertNotEquals(null, LoginFrame.setPassword()); } + + @Test + public void testSetLeeren() { + + assertEquals("", LoginFrame.benutzernameLeeren()); + assertNotEquals(" ", LoginFrame.benutzernameLeeren()); + assertNotEquals("".length() > 0 , LoginFrame.benutzernameLeeren()); + assertNotEquals(""==null, LoginFrame.benutzernameLeeren()); + + } } diff --git a/Command.txt b/Command.txt index f5253bd..0c56c72 100644 --- a/Command.txt +++ b/Command.txt @@ -1,3 +1,4 @@ Befehle: L: Alle Einträge leeren +F5: Exit