From 6e1f2eb3c588f3a05f0026dbf769a3931795643e Mon Sep 17 00:00:00 2001 From: Adah Boukhari Date: Fri, 7 Feb 2020 15:34:48 +0100 Subject: [PATCH] Commit_42 (Bugfix) KeyListener in LoginFrame_Class hinzugefuegt. Enter_Key bei Anmelden --- .../bin/MeinBudgetView/LoginFrame.class | Bin 4154 -> 4251 bytes .../src/MeinBudgetView/LoginFrame.java | 19 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Budget Projekt/bin/MeinBudgetView/LoginFrame.class b/Budget Projekt/bin/MeinBudgetView/LoginFrame.class index 97b5f751252a782a9a52dd8e7ec25b7e5637c9c8..f936ee6f74ca14a326aed9899c2fae304b54c1de 100644 GIT binary patch delta 1018 zcmaiyYfO!C9LGQZbLu?Ld3q+xDlOe(Hn1gFp zW4$XX4a;DmZKmTh*-xpp!!j(w^ZviSZnpA=WNW`l(L~X zuOK&NcKX_)yuyNcIR##m8{D*-^l4$Y6fstzJ0{YgnP}UznzYewCA+ujwLCU?!c)ud z-f3kU$q@!`d8g4Oo2@t_Hp=9^4aCUx7R~W)o?f`zYwa@f-CxnewHyV}4&-}yy zd;DaG+nZR!4DtIy#{;3_!77o;L77-TNmiG6u%v}Fb&quQjCrb)`RXGJI3)F%q17Db zh@3iNTEiwzN-kXOW|3qoaLLSR&WIf#dz$2S zr}*qK0nXYGOUfA`5CixF1bjpa&Hz^=-j8Y5qpn`!+VAFaM)&lVF}SC{7BOu`Eb;SP0fHx&n|p+!fFngmaJk z0{ek13db3*r{LzHyp=EgqQ^a&lUOPFkferq@QQFNf;&x_*Ch9h=aP5x;@?C0(zxm` zLyDKYvMM8EO6-4TYYFRueKEnyR1aW92d|~B=;W1HTkTTmvDHo$0pIjD4l}-&d_#N5 zH=vJv6}_bYEoBA_v0nrmg-9`R@}Cpf%viSIVJnl_-b=>R9#pBnP$l${F${-C7mOc5 R+&q7{?f4J3kAlEK_fPi0^=$wE delta 976 zcmaiy$xjqP6oi2%tjjQ_7jPbvHL%@1| z`ixplFW{odCF-qnTCR0k)BO`#lycvr&Bc91iq-B)ahkOA!20D{qxnoa@muM7Ms7Df zE&_`9shafa_MOL%?;VRcq{N^jyWfrAU803b`9BKoN+~gL~>M&KbNY1Iw3*olpG&ysJ zyD}~l&WPOVkhpJMfL2>t3#&y^0B=Wtu6p7`W`I7KH(=WP3H`kc&KG9}i|yKGQX{p^ z#P>5=+QZYrtmpvG?Cu=F?$Xg^zLOYskwFPrlv2QMirFKpz4Gl3cAMr6$qKhC0vTsQ zM3>-Xl9wX;m4KW$GV~nWOyLiAlqXTimRpqd@_MVMLlz-x4T*3-j64{;#FRpph<6D}g`BMX4@EJ<$FP)YVcX^=i(j8Y<}T(-0?|@~a9~`J8Nq&o5ohvlESvCJ-*$)pVgVYtF%?MS6sfzDmL_RFa@Giml5xjiv EA4w?DYybcN diff --git a/Budget Projekt/src/MeinBudgetView/LoginFrame.java b/Budget Projekt/src/MeinBudgetView/LoginFrame.java index 3c34955..017aa30 100644 --- a/Budget Projekt/src/MeinBudgetView/LoginFrame.java +++ b/Budget Projekt/src/MeinBudgetView/LoginFrame.java @@ -74,9 +74,11 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { contentPane.add(loginHauptImage); this.anmelden.addActionListener(this); - this.anmelden.addKeyListener(this); passwordField.addActionListener(this); benutzername.addActionListener(this); + this.anmelden.addKeyListener(this); + benutzername.addKeyListener(this); + passwordField.addKeyListener(this); } @Override @@ -107,17 +109,20 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { @Override public void keyTyped(KeyEvent e) { - - if (e.getSource() == this.anmelden) { - MeinGui run = new MeinGui(); - run.setVisible(true); - } + // TODO Auto-generated method stub } @Override public void keyPressed(KeyEvent e) { - // TODO Auto-generated method stub + if (e.getKeyCode() == KeyEvent.VK_ENTER) { + if (benutzername.getText().length() > 0 && passwordField.getText().length() > 0) { + MeinGui run = new MeinGui(); + run.setVisible(true); + } else { + JOptionPane.showMessageDialog(this.anmelden, "Bitte geben Sie die richtigen Daten ein!"); + } + } } @Override