From 67105d228ed4976e73ed62b95db40ad8f485d7b4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 21 Jun 2011 04:52:11 +0200 Subject: Reset login panel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@542 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/LoginPanel.java | 10 +++++++--- src/jrummikub/view/impl/View.java | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jrummikub/view/impl/LoginPanel.java b/src/jrummikub/view/impl/LoginPanel.java index 4712630..43c7550 100644 --- a/src/jrummikub/view/impl/LoginPanel.java +++ b/src/jrummikub/view/impl/LoginPanel.java @@ -48,15 +48,12 @@ class LoginPanel extends JPanel implements ILoginPanel { }; userNameField = addInputRow("Benutzername:", new JTextField()); - userNameField.setText("test1"); userNameField.addActionListener(loginAction); serverNameField = addInputRow("Server:", new JTextField()); - serverNameField.setText("universe-factory.net"); serverNameField.addActionListener(loginAction); passwordField = addInputRow("Passwort:", new JPasswordField()); passwordField.addActionListener(loginAction); channelNameField = addInputRow("Channel:", new JTextField()); - channelNameField.setText("jrummikub@muc.universe-factory.net"); channelNameField.addActionListener(loginAction); add(Box.createVerticalGlue(), c); @@ -84,6 +81,13 @@ class LoginPanel extends JPanel implements ILoginPanel { 10, 10, 10, 10))); } + void resetLoginPanel() { + userNameField.setText("test1"); + serverNameField.setText("universe-factory.net"); + passwordField.setText(""); + channelNameField.setText("jrummikub@muc.universe-factory.net"); + } + @Override public IEvent1 getLoginEvent() { return loginEvent; diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index 5d870f9..06795aa 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -504,6 +504,10 @@ public class View extends JFrame implements IView { @Override public void showLoginPanel(boolean show) { loginPanel.setVisible(show); + + if (show) { + loginPanel.resetLoginPanel(); + } } @Override -- cgit v1.2.3