title: Retrieving metadata album cover from media files in JavaFX
body: <p>I've created a MediaPlayer which plays the music chosen by the user when he selects the song from the listview. I'm trying to display the metadata of each track whenever it's selected including the album cover (Which I was unable to display).
  <a href="https://i.stack.imgur.com/PoBVY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PoBVY.png" alt="enter image description here" /></a></p>
  <p>And here's my list view:</p>
  <p><a href="https://i.stack.imgur.com/pNsIX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pNsIX.png" alt="enter image description here" /></a></p>
  <p>The album cover should be displayed in the imageview I've created:</p>
  <pre><code>  @FXML
       ListView&lt;File&gt; listV ;
   @FXML
      private ImageView imv;
   File songs;
      URI path;
       Media test;
         MediaPlayer finale;
  
  songs = listV.getSelectionModel().getSelectedItem();
           path = songs .toURI();
       test = new Media(Paths.get(path).toUri().toString());
       finale = new MediaPlayer(test); 
  ObservableMap&lt;String,Object&gt; meta_data= finale.getMedia().getMetadata();
  
       meta_data.addListener(new MapChangeListener&lt;String,Object&gt;(){
            @Override
            public void onChanged(Change&lt;? extends String, ? extends Object&gt; ch) {  
       
               if(ch.wasAdded()){
  
                     String key=ch.getKey();
                     Object value=ch.getValueAdded();
  
               switch(key){
                 case &quot;album&quot;:
                     albumT.setText(&quot;Album: &quot;+value.toString());
                     break;
                 case &quot;artist&quot;:  
                     artistF.setText(&quot;Artist: &quot;+value.toString());
                     break;
                 case &quot;title&quot;:
                     nameF.setText(&quot;Title: &quot;+value.toString());
                     break;
                 case &quot;year&quot;:
                     YearT.setText(&quot;Year: &quot;+value.toString());
                     break;
                 case &quot;image&quot;:
                     imv.setImage((Image)value);
                     break;
             }
               
                }
            }
       });
  
  </code></pre>
  <p>Can anyone tell me why the pictures ain't displaying? Thanks!</p>