From 85deab7e63f20fd9973361cd5ac5b635d004a5ea Mon Sep 17 00:00:00 2001 From: Lenni0451 <20379977+Lenni0451@users.noreply.github.com> Date: Sat, 16 Sep 2023 19:45:22 +0200 Subject: [PATCH] Use grid variable --- .../java/net/raphimc/viaproxy/ui/impl/AccountsTab.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/AccountsTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/AccountsTab.java index f63a850..35ec9e1 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/AccountsTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/AccountsTab.java @@ -62,6 +62,7 @@ public class AccountsTab extends AUITab { JPanel body = new JPanel(); body.setLayout(new GridBagLayout()); + int gridy = 0; { JLabel infoLabel = new JLabel(""" @@ -71,7 +72,7 @@ public class AccountsTab extends AUITab {
If you change your account frequently, you can install OpenAuthMod on your client.
This allows ViaProxy to use the account you are logged in with on the client.
"""); - GBC.create(body).grid(0, 0).weightx(1).insets(BORDER_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(infoLabel); + GBC.create(body).grid(0, gridy++).weightx(1).insets(BORDER_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(infoLabel); } { JScrollPane scrollPane = new JScrollPane(); @@ -160,7 +161,7 @@ public class AccountsTab extends AUITab { contextMenu.add(moveDown); } this.accountsList.setComponentPopupMenu(contextMenu); - GBC.create(body).grid(0, 1).weight(1, 1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GridBagConstraints.BOTH).add(scrollPane); + GBC.create(body).grid(0, gridy++).weight(1, 1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, 0, BORDER_PADDING).fill(GridBagConstraints.BOTH).add(scrollPane); } { final JPanel addButtons = new JPanel(); @@ -208,7 +209,7 @@ public class AccountsTab extends AUITab { border.setBorder(BorderFactory.createTitledBorder("Add Account")); GBC.create(border).grid(0, 0).weightx(1).insets(2, 4, 4, 4).fill(GridBagConstraints.HORIZONTAL).add(addButtons); - GBC.create(body).grid(0, 2).weightx(1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(border); + GBC.create(body).grid(0, gridy++).weightx(1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(border); } contentPane.setLayout(new BorderLayout());