diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-22 02:00:04 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-22 02:00:04 +0200 |
commit | 79ae31b1c75e5f33760c500a08a504a195c565f8 (patch) | |
tree | 684179dd3bec5b3f862a0a2b996f78dcfc0ba439 /src | |
parent | ea8a675cee038eba98de3eefc0f7f0d0290392d7 (diff) | |
download | JRummikub-79ae31b1c75e5f33760c500a08a504a195c565f8.tar JRummikub-79ae31b1c75e5f33760c500a08a504a195c565f8.zip |
Fix in LoginPanel
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@568 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src')
-rw-r--r-- | src/jrummikub/view/impl/LoginPanel.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/jrummikub/view/impl/LoginPanel.java b/src/jrummikub/view/impl/LoginPanel.java index 1ea49da..9fef581 100644 --- a/src/jrummikub/view/impl/LoginPanel.java +++ b/src/jrummikub/view/impl/LoginPanel.java @@ -34,7 +34,7 @@ class LoginPanel extends JPanel implements ILoginPanel { private JTextField passwordField; private JTextField channelNameField; private JButton startDedicatedServerButton; - + LoginPanel() { setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); @@ -44,7 +44,7 @@ class LoginPanel extends JPanel implements ILoginPanel { c.weighty = 1; ActionListener loginAction = createInputFields(); - + c.weighty = 0; add(startDedicatedServerButton, c); startDedicatedServerButton.addActionListener(new ActionListener() { @@ -53,7 +53,7 @@ class LoginPanel extends JPanel implements ILoginPanel { useDedicatedServer.emit(passwordField.getText()); } }); - + c.weighty = 1; add(Box.createVerticalGlue(), c); @@ -77,8 +77,8 @@ class LoginPanel extends JPanel implements ILoginPanel { }); add(cancelButton, c); - setBorder(new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder( - 10, 10, 10, 10))); + setBorder(new CompoundBorder(new LineBorder(Color.BLACK), + new EmptyBorder(10, 10, 10, 10))); } private ActionListener createInputFields() { @@ -99,7 +99,7 @@ class LoginPanel extends JPanel implements ILoginPanel { channelNameField.addActionListener(loginAction); startDedicatedServerButton = new JButton("Dedizierten Server starten"); // this fixes some strange layouting bug - startDedicatedServerButton.setPreferredSize(new Dimension(500,10)); + startDedicatedServerButton.setPreferredSize(new Dimension(500, 10)); return loginAction; } @@ -125,7 +125,7 @@ class LoginPanel extends JPanel implements ILoginPanel { public IEvent1<String> getUseDedicatedServerEvent() { return useDedicatedServer; } - + private JTextField addInputRow(String label, JTextField textField) { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; @@ -144,14 +144,15 @@ class LoginPanel extends JPanel implements ILoginPanel { private void login() { loginEvent.emit(new LoginData(userNameField.getText(), serverNameField - .getText(), passwordField.getText(), channelNameField.getText())); + .getText(), passwordField.getText().isEmpty() ? "jrummikub" + : passwordField.getText(), channelNameField.getText())); } @Override public void setServer(String server) { serverNameField.setText(server); } - + @Override public void setChannel(String channel) { channelNameField.setText(channel); @@ -159,6 +160,8 @@ class LoginPanel extends JPanel implements ILoginPanel { @Override public void setDedicatedServerRunning(boolean running) { - startDedicatedServerButton.setText(running ? "Dedizierten Server nutzen" : "Dedizierten Server starten"); + startDedicatedServerButton + .setText(running ? "Dedizierten Server nutzen" + : "Dedizierten Server starten"); } } |