From 97f8e52a169fcf0356de566f1efd7f2ccfbfd9a4 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Mon, 29 Feb 2016 03:22:20 +0000 Subject: [PATCH] Added missing album art icon. --- .../java/musicplayer/LibraryTreeCellRenderer.java | 2 ++ src/main/resources/missing.gif | Bin 0 -> 825 bytes 2 files changed, 2 insertions(+) create mode 100644 src/main/resources/missing.gif 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 0000000000000000000000000000000000000000..8a2db0b4d07307a5c9c3014872a7f00e159d9049 GIT binary patch literal 825 zcmZ?wbhEHbG-5DfI2OVH1dNP~OiWD7%*-q-EUc`ooSdB8+}!;9{DOjlqN1W=Vqy{! z5|WaVQc_YXDk`d~s%mO#8X6i}T3TjiW>!{K*4EZePEIZ^E^cma?(XhhUS7VwzW)CH zK|w)bVPT1hiAhOG>FMd&+1UjJ1w}y}i8? zCQO(*b?Tfsa~3REuyEnRMT-_KU%q_BiWMtYu3Woz?fUiWH*DCjY15_y2M!!QeE7(b zBPULrICbjO>C>mroH=vx;>D|1uU@}?{r>&?4<0;t^ytxx7cXAEeEI(U`%j-feg6FU z>({S8e*F0T`}dzefBydc`|sbs|APQ1{$yd~VyI`(0mTF;P8it#H83WDIR-ng)J4a41DFGCr& zwkK0=O}{hI&q{&o`psttUQ7wH(_v^Z_moqun(oGPN1aPiwUtFxa?X