diff --git a/src/main/java/musicplayer/LibraryTreeCellRenderer.java b/src/main/java/musicplayer/LibraryTreeCellRenderer.java index af849fe..48ffa87 100644 --- a/src/main/java/musicplayer/LibraryTreeCellRenderer.java +++ b/src/main/java/musicplayer/LibraryTreeCellRenderer.java @@ -10,6 +10,7 @@ import java.awt.*; class LibraryTreeCellRenderer implements TreeCellRenderer { private final JLabel label; + private static Icon missingIcon = new ImageIcon(LibraryTreeCellRenderer.class.getClassLoader().getResource("missing.gif")); LibraryTreeCellRenderer() { label = new JLabel(); @@ -23,6 +24,7 @@ class LibraryTreeCellRenderer implements TreeCellRenderer { label.setText(o.toString()); if (o instanceof Album) { Album album = (Album) o; + label.setIcon(missingIcon); album.getAlbumArt().ifPresent(x -> label.setIcon(new ImageIcon(x))); } } diff --git a/src/main/resources/missing.gif b/src/main/resources/missing.gif new file mode 100644 index 0000000..8a2db0b Binary files /dev/null and b/src/main/resources/missing.gif differ