From f0e58211458e21a557de65be7f46152fb1ab9311 Mon Sep 17 00:00:00 2001 From: Lenni0451 <20379977+Lenni0451@users.noreply.github.com> Date: Wed, 4 Jan 2023 21:10:24 +0100 Subject: [PATCH] Added copyright and discord link --- .../net/raphimc/viaproxy/ui/ViaProxyUI.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/net/raphimc/viaproxy/ui/ViaProxyUI.java b/src/main/java/net/raphimc/viaproxy/ui/ViaProxyUI.java index d2ccb8c..aac1953 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/ViaProxyUI.java +++ b/src/main/java/net/raphimc/viaproxy/ui/ViaProxyUI.java @@ -9,6 +9,9 @@ import net.raphimc.viaproxy.util.logging.Logger; import javax.swing.*; import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.net.URI; public class ViaProxyUI extends JFrame { @@ -75,6 +78,29 @@ public class ViaProxyUI extends JFrame { titleLabel.setFont(titleLabel.getFont().deriveFont(30F)); this.contentPane.add(titleLabel); } + { + JLabel copyrightLabel = new JLabel("© RK_01 & Lenni0451"); + copyrightLabel.setBounds(360, 10, 500, 20); + this.contentPane.add(copyrightLabel); + } + { + JLabel discordLabel = new JLabel("Discord"); + discordLabel.setBounds(10, 10, 500, 20); + discordLabel.setForeground(new Color(124, 171, 241)); + discordLabel.addMouseListener(new MouseAdapter() { + private static final String LINK = "https://viaproxy.raphimc.net"; + + @Override + public void mouseReleased(MouseEvent e) { + try { + Desktop.getDesktop().browse(new URI(LINK)); + } catch (Throwable t) { + showInfo("Couldn't open the link :(\nHere it is for you: " + LINK); + } + } + }); + this.contentPane.add(discordLabel); + } { JLabel addressLabel = new JLabel("Server Address:"); addressLabel.setBounds(10, 50, 100, 20);