Added missing album art icon.

This commit is contained in:
neviyn 2016-02-29 03:22:20 +00:00
parent e8bb7b9b66
commit 97f8e52a16
2 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import java.awt.*;
class LibraryTreeCellRenderer implements TreeCellRenderer { class LibraryTreeCellRenderer implements TreeCellRenderer {
private final JLabel label; private final JLabel label;
private static Icon missingIcon = new ImageIcon(LibraryTreeCellRenderer.class.getClassLoader().getResource("missing.gif"));
LibraryTreeCellRenderer() { LibraryTreeCellRenderer() {
label = new JLabel(); label = new JLabel();
@ -23,6 +24,7 @@ class LibraryTreeCellRenderer implements TreeCellRenderer {
label.setText(o.toString()); label.setText(o.toString());
if (o instanceof Album) { if (o instanceof Album) {
Album album = (Album) o; Album album = (Album) o;
label.setIcon(missingIcon);
album.getAlbumArt().ifPresent(x -> label.setIcon(new ImageIcon(x))); album.getAlbumArt().ifPresent(x -> label.setIcon(new ImageIcon(x)));
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B