diff --git a/src/java.desktop/share/classes/javax/swing/ImageIcon.java b/src/java.desktop/share/classes/javax/swing/ImageIcon.java
index 860235fefd..f097186d8c 100644
--- a/src/java.desktop/share/classes/javax/swing/ImageIcon.java
+++ b/src/java.desktop/share/classes/javax/swing/ImageIcon.java
@@ -309,14 +309,23 @@ public class ImageIcon implements Icon, Serializable, Accessible {
         synchronized(mTracker) {
             int id = getNextID();
 
-            mTracker.addImage(image, id);
             try {
+                loadStatus = 0;
+                mTracker.addImage(image, id);
                 mTracker.waitForID(id, 0);
-            } catch (InterruptedException e) {
-                System.out.println("INTERRUPTED while loading Image");
+            } catch (InterruptedException e1) {
+                try {
+                    mTracker.waitForID(id, 0);
+                } catch (InterruptedException e2) {
+                    loadStatus = MediaTracker.ABORTED;
+                    Thread.currentThread().interrupt();
+                }
+            } finally {
+                if (loadStatus == 0) {
+                    loadStatus = mTracker.statusID(id, false);
+                }
+                mTracker.removeImage(image, id);
             }
-            loadStatus = mTracker.statusID(id, false);
-            mTracker.removeImage(image, id);
 
             width = image.getWidth(imageObserver);
             height = image.getHeight(imageObserver);
diff --git a/test/jdk/javax/swing/imageIconInterrupted.java b/test/jdk/javax/swing/imageIconInterrupted.java
new file mode 100644
index 0000000000..149e62f1b0
--- /dev/null
+++ b/test/jdk/javax/swing/imageIconInterrupted.java
@@ -0,0 +1,41 @@
+import javax.swing.*;
+import java.awt.*;
+import java.net.URL;
+
+/*
+ * @test
+ * @bug unknown
+ * @summary the test tries to load a gif-icon under different circumstances. When the GIF is valid, the image load
+ *          status is COMPLETE. When the image doesn't exist - ERRORED. When the image load is interrupted, we try to
+ *          reload it again.
+ * @run main/othervm imageIconInterrupted
+ */
+
+public class imageIconInterrupted {
+    static byte[] EMPTY_GIF = new byte[]{
+            (byte) 0x47, (byte) 0x49, (byte) 0x46, (byte) 0x38, (byte) 0x39, (byte) 0x61, (byte) 0x01, (byte) 0x00,
+            (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x21, (byte) 0xF9, (byte) 0x04,
+            (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x2C, (byte) 0x00, (byte) 0x00,
+            (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x02
+    };
+
+    public static void main(String[] args) throws Exception {
+        Toolkit ignoreToolkit = Toolkit.getDefaultToolkit();
+
+        ImageIcon iconGif = new ImageIcon(EMPTY_GIF);
+        if (iconGif.getImageLoadStatus() != MediaTracker.COMPLETE) {
+            throw new RuntimeException("Couldn't load GIF from bytes");
+        }
+
+        ImageIcon iconNotExist = new ImageIcon(new URL("http://doesnt.exist.anywhere/1.gif"));
+        if (iconNotExist.getImageLoadStatus() != MediaTracker.ERRORED) {
+            throw new RuntimeException("Got unexpected status from non-existing GIF");
+        }
+
+        Thread.currentThread().interrupt();
+        ImageIcon iconInterrupt = new ImageIcon(EMPTY_GIF);
+        if (iconInterrupt.getImageLoadStatus() != MediaTracker.COMPLETE) {
+            throw new RuntimeException("Couldn't load GIF from bytes after interruption");
+        }
+    }
+}
