Added missing album art icon.
This commit is contained in:
parent
e8bb7b9b66
commit
97f8e52a16
@ -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)));
|
||||
}
|
||||
}
|
||||
|
BIN
src/main/resources/missing.gif
Normal file
BIN
src/main/resources/missing.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 825 B |
Loading…
Reference in New Issue
Block a user