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 {
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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