From 5fe8b50012514bcd3b5a139246a7035c90bfe37c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jun 2011 17:43:16 +0200 Subject: Add padding between buttons in login panel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@401 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/LoginPanel.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/jrummikub/view/impl/LoginPanel.java b/src/jrummikub/view/impl/LoginPanel.java index ca9f37f..d6260ff 100644 --- a/src/jrummikub/view/impl/LoginPanel.java +++ b/src/jrummikub/view/impl/LoginPanel.java @@ -44,18 +44,21 @@ class LoginPanel extends JPanel implements ILoginPanel { c.gridwidth = 1; c.weighty = 0; - JButton loginButton = new JButton("Login"); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { - loginEvent.emit(userNameField.getText(), - passwordField.getText(), channelNameField.getText()); + loginEvent.emit(userNameField.getText(), passwordField.getText(), + channelNameField.getText()); } }); add(loginButton, c); + c.weightx = 0; + add(Box.createHorizontalStrut(10), c); + c.gridwidth = GridBagConstraints.REMAINDER; + c.weightx = 1; JButton cancelButton = new JButton("Abbrechen"); cancelButton.addActionListener(new ActionListener() { @Override @@ -65,8 +68,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))); } @Override -- cgit v1.2.3