summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/LoginPanel.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jrummikub/view/impl/LoginPanel.java b/src/jrummikub/view/impl/LoginPanel.java
index 9fef581..0cca29d 100644
--- a/src/jrummikub/view/impl/LoginPanel.java
+++ b/src/jrummikub/view/impl/LoginPanel.java
@@ -34,7 +34,8 @@ class LoginPanel extends JPanel implements ILoginPanel {
private JTextField passwordField;
private JTextField channelNameField;
private JButton startDedicatedServerButton;
-
+ private static final String DEFAULT_PASSWORD = "jrummikub";
+
LoginPanel() {
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
@@ -50,7 +51,8 @@ class LoginPanel extends JPanel implements ILoginPanel {
startDedicatedServerButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
- useDedicatedServer.emit(passwordField.getText());
+ useDedicatedServer.emit(passwordField.getText().isEmpty() ? DEFAULT_PASSWORD
+ : passwordField.getText());
}
});
@@ -144,7 +146,7 @@ class LoginPanel extends JPanel implements ILoginPanel {
private void login() {
loginEvent.emit(new LoginData(userNameField.getText(), serverNameField
- .getText(), passwordField.getText().isEmpty() ? "jrummikub"
+ .getText(), passwordField.getText().isEmpty() ? DEFAULT_PASSWORD
: passwordField.getText(), channelNameField.getText()));
}