Fixed Envoy logo loading for StatusTrayIcon

This commit is contained in:
Kai S. K. Engelbart 2019-12-05 15:13:19 +01:00
parent 50945a45a2
commit 6dad4eda08

View File

@ -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.");