From ca4369d60e5bc6436e415aa7a8245201e221b0dc Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Thu, 5 Dec 2019 15:13:19 +0100 Subject: [PATCH] Fixed Envoy logo loading for StatusTrayIcon --- src/main/java/envoy/client/ui/StatusTrayIcon.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/client/ui/StatusTrayIcon.java b/src/main/java/envoy/client/ui/StatusTrayIcon.java index 951fbd4..94d30d0 100644 --- a/src/main/java/envoy/client/ui/StatusTrayIcon.java +++ b/src/main/java/envoy/client/ui/StatusTrayIcon.java @@ -44,7 +44,8 @@ public class StatusTrayIcon implements EventHandler { public StatusTrayIcon() throws EnvoyException { if (!SystemTray.isSupported()) throw new EnvoyException("The Envoy tray icon is not supported."); - Image img = Toolkit.getDefaultToolkit().createImage(getClass().getResource("envoy_logo.png")); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + Image img = Toolkit.getDefaultToolkit().createImage(loader.getResource("envoy_logo.png")); trayIcon = new TrayIcon(img, "Envoy Client"); trayIcon.setImageAutoSize(true); trayIcon.setToolTip("You are notified if you have unread messages.");