From aaf319e9f425cc7c5e941ca5ed91db135d6fd494 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 31 Jan 2017 01:09:52 +0100 Subject: [PATCH] Fixed issue with image creation callbacks --- src/dorkbox/notify/Notify.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dorkbox/notify/Notify.java b/src/dorkbox/notify/Notify.java index 15d1331..696f4c4 100644 --- a/src/dorkbox/notify/Notify.java +++ b/src/dorkbox/notify/Notify.java @@ -282,7 +282,11 @@ class Notify { if (name != null) { imageIcon = imageIconCache.get(name); if (imageIcon == null) { - imageIcon = new ImageIcon(graphic); + Image image = new ImageIcon(graphic).getImage(); + + // have to do this twice, so that it will finish loading the image (weird callback stuff is required if we don't do this) + imageIcon = new ImageIcon(image); + imageIconCache.put(name, imageIcon); } }