diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/ServerLauncherGUI.java b/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/ServerLauncherGUI.java index 31e73ed..77eb499 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/ServerLauncherGUI.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/userinterface/ServerLauncherGUI.java @@ -16,11 +16,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; +import java.io.*; import java.util.ArrayList; import java.util.Objects; import java.util.Scanner; @@ -444,7 +440,14 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener, private void tray() { if (SystemTray.isSupported()) { tray = SystemTray.getSystemTray(); - Image trayImage = Toolkit.getDefaultToolkit().getImage("files/GUIIcon.png"); + InputStream imageStream = CommonFunctions.getResourceAsStream("GUIIcon.png"); + Image trayImage; + try { + trayImage = ImageIO.read(imageStream); + } catch (IOException e) { + trayImage = Toolkit.getDefaultToolkit().getImage("resources/GUIIcon.png"); + e.printStackTrace(); + } PopupMenu popup = new PopupMenu(); trayIcon = new TrayIcon(trayImage, "Minecraft Server Launcher", popup); trayIcon.setImageAutoSize(true);