diff options
| author | unknown | 2014-04-14 15:03:16 +0200 |
|---|---|---|
| committer | unknown | 2014-04-14 15:03:16 +0200 |
| commit | ba7a3b300ee0fae2ce8d294adea3d1b06b007e42 (patch) | |
| tree | c5169c8055e7a15e22de94e64feedb65c8be3600 /Dozentenmodul/src | |
| parent | Check eingebaut, ob Verbindungsdaten vom Server empfangen werden (diff) | |
| download | tutor-module-ba7a3b300ee0fae2ce8d294adea3d1b06b007e42.tar.gz tutor-module-ba7a3b300ee0fae2ce8d294adea3d1b06b007e42.tar.xz tutor-module-ba7a3b300ee0fae2ce8d294adea3d1b06b007e42.zip | |
Größe Eingabefelder geändert, Fehlermeldung präzisiert
Diffstat (limited to 'Dozentenmodul/src')
| -rw-r--r-- | Dozentenmodul/src/gui/intro/Login_GUI.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 81fb223b..27b3cd18 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -44,7 +44,7 @@ public class Login_GUI extends JFrame { JLabel lblConnectionInfo = new JLabel(""); boolean isClientReturnedCorrectly = false; boolean login; - String masterServerIP = "132.230.4.16"; + String masterServerIP = MasterThriftConnection.MASTERSERVERIP; MasterThriftConnection thrift; Client client; String token; @@ -143,7 +143,7 @@ public class Login_GUI extends JFrame { performLogin(); } }); - lblusername.setBounds(304, 164, 196, 20); + lblusername.setBounds(292, 164, 237, 20); contentPane.add(lblusername); lblusername.setColumns(10); @@ -160,7 +160,7 @@ public class Login_GUI extends JFrame { }// end actionPerformed }); - BtnLogin.setBounds(304, 244, 196, 23); + BtnLogin.setBounds(292, 244, 237, 23); contentPane.add(BtnLogin); // Erzeugen und Hinzufügen des Passwortfeldes @@ -171,19 +171,16 @@ public class Login_GUI extends JFrame { performLogin(); } }); - lblpass.setBounds(304, 195, 196, 20); + lblpass.setBounds(292, 195, 237, 20); contentPane.add(lblpass); lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT); - lblConnectionInfo.setBounds(304, 290, 196, 20); + lblConnectionInfo.setBounds(292, 290, 237, 20); contentPane.add(lblConnectionInfo); }// end LoginGUI() // Versuche den Benutzer einzuloggen public void performLogin() { - // show user, the client is doing something.. - lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo.setText("Error: Server nicht erreichbar."); login = false; thrift = new MasterThriftConnection(); @@ -201,9 +198,6 @@ public class Login_GUI extends JFrame { // null package if (checkClientPackage() == true) { // package has information - lblConnectionInfo.setForeground(Color.black); - lblConnectionInfo.setText("Verbindung wird aufgebaut..."); - result = client.authenticate(lblusername.getText(), passText); SessionData.session.setAuthToken(result.authToken); SessionData.session.setSessionID(result.sessionId); @@ -279,7 +273,7 @@ public class Login_GUI extends JFrame { // package from server is null login = false; lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo.setText("Fehler: Verbindung nicht möglich."); + lblConnectionInfo.setText("Fehler: Client nicht mit Server verbunden."); } @@ -305,13 +299,13 @@ public class Login_GUI extends JFrame { if (client != null) { // client contains information isClientReturnedCorrectly = true; - System.out.println("Server " + masterServerIP - + " ist erreichbar, Verbindungsinformationen erhalten"); + System.out.println("Masterserver (" + masterServerIP + + ") ist erreichbar, Verbindungsinformationen erhalten"); } else { // client has returned with error isClientReturnedCorrectly = false; - System.out.println("Fehler: Client " + masterServerIP - + " hat keine korrekten Verbindungsdaten erhalten."); + System.out.println("Fehler: Client hat von Masterserver (" + masterServerIP + + ") hat keine korrekten Verbindungsdaten erhalten."); } return isClientReturnedCorrectly; |
