diff --git a/build.gradle b/build.gradle index aa50a3e..1b6e3c7 100644 --- a/build.gradle +++ b/build.gradle @@ -116,7 +116,6 @@ dependencies { exclude group: "io.netty", module: "netty-transport" } include "gs.mclo:api:3.0.1" - include "org.swinglabs:swingx:1.6.1" } sourceSets { diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/AdvancedTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/AdvancedTab.java index 60e55f5..6996ebc 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/AdvancedTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/AdvancedTab.java @@ -32,7 +32,6 @@ import net.raphimc.viaproxy.util.GBC; import net.raphimc.viaproxy.util.logging.Logger; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender; -import org.jdesktop.swingx.VerticalLayout; import javax.swing.*; import java.awt.*; @@ -60,18 +59,10 @@ public class AdvancedTab extends AUITab { @Override protected void init(JPanel contentPane) { - JPanel top = new JPanel(); - top.setLayout(new VerticalLayout()); - - JPanel bottom = new JPanel(); - bottom.setLayout(new VerticalLayout()); - - this.addBody(top); - this.addFooter(bottom); - contentPane.setLayout(new BorderLayout()); - contentPane.add(top, BorderLayout.NORTH); - contentPane.add(bottom, BorderLayout.SOUTH); + + this.addBody(contentPane); + this.addFooter(contentPane); } private void addBody(final Container parent) { @@ -126,7 +117,7 @@ public class AdvancedTab extends AUITab { GBC.create(body).grid(0, gridy++).weightx(1).insets(BODY_BLOCK_PADDING, BORDER_PADDING, 0, 0).fill(GridBagConstraints.HORIZONTAL).add(this.ignorePacketTranslationErrors); } - parent.add(body, BorderLayout.CENTER); + parent.add(body, BorderLayout.NORTH); } private void addFooter(final Container container) { @@ -189,7 +180,7 @@ public class AdvancedTab extends AUITab { padding.setLayout(new GridBagLayout()); GBC.create(padding).grid(0, 0).weightx(1).insets(0, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(footer); - container.add(padding, BorderLayout.CENTER); + container.add(padding, BorderLayout.SOUTH); } @EventHandler diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java index d0acb51..fbef47b 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/GeneralTab.java @@ -33,7 +33,6 @@ import net.raphimc.viaproxy.ui.events.UICloseEvent; import net.raphimc.viaproxy.ui.events.UIInitEvent; import net.raphimc.viaproxy.util.GBC; import net.raphimc.viaproxy.util.logging.Logger; -import org.jdesktop.swingx.VerticalLayout; import javax.swing.*; import java.awt.*; @@ -63,18 +62,14 @@ public class GeneralTab extends AUITab { @Override protected void init(JPanel contentPane) { JPanel top = new JPanel(); - top.setLayout(new VerticalLayout()); - - JPanel bottom = new JPanel(); - bottom.setLayout(new VerticalLayout()); - - this.addHeader(top); - this.addBody(top); - this.addFooter(bottom); + top.setLayout(new BorderLayout()); contentPane.setLayout(new BorderLayout()); contentPane.add(top, BorderLayout.NORTH); - contentPane.add(bottom, BorderLayout.SOUTH); + + this.addHeader(top); + this.addBody(top); + this.addFooter(contentPane); } private void addHeader(final Container parent) { @@ -98,7 +93,7 @@ public class GeneralTab extends AUITab { JLabel copyright = new JLabel("© RK_01 & Lenni0451"); GBC.create(header).grid(2, 0).width(0).insets(BORDER_PADDING, 0, 0, BORDER_PADDING).anchor(GridBagConstraints.NORTHEAST).add(copyright); - parent.add(header); + parent.add(header, BorderLayout.NORTH); } private void addBody(final Container parent) { @@ -163,7 +158,7 @@ public class GeneralTab extends AUITab { } } - parent.add(body); + parent.add(body, BorderLayout.CENTER); } private void addFooter(final Container parent) { @@ -182,7 +177,7 @@ public class GeneralTab extends AUITab { this.stateButton.setEnabled(false); GBC.create(footer).grid(0, 1).weightx(1).insets(0, BORDER_PADDING, BORDER_PADDING, BORDER_PADDING).anchor(GridBagConstraints.WEST).fill(GridBagConstraints.HORIZONTAL).add(this.stateButton); - parent.add(footer); + parent.add(footer, BorderLayout.SOUTH); } @EventHandler diff --git a/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java b/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java index 093e77c..169f58d 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java +++ b/src/main/java/net/raphimc/viaproxy/ui/impl/UISettingsTab.java @@ -23,7 +23,6 @@ import net.raphimc.viaproxy.ui.I18n; import net.raphimc.viaproxy.ui.ViaProxyUI; import net.raphimc.viaproxy.util.GBC; import net.raphimc.viaproxy.util.logging.Logger; -import org.jdesktop.swingx.VerticalLayout; import javax.swing.*; import java.awt.*; @@ -78,8 +77,8 @@ public class UISettingsTab extends AUITab { GBC.create(body).grid(0, gridy++).weightx(1).insets(0, BORDER_PADDING, 0, BORDER_PADDING).fill(GridBagConstraints.HORIZONTAL).add(language); } - contentPane.setLayout(new VerticalLayout()); - contentPane.add(body); + contentPane.setLayout(new BorderLayout()); + contentPane.add(body, BorderLayout.NORTH); } }