A Set of imagefiles are added to an arraylist(filelist2) of type File.Then an imageview and a button are affffded to a vbox,such vboxes are added to a grids of a gripane using a
Use setUserData and getUserData to store and retrieve custom values in Nodes ! Set the fileName
as the userdata and on click, retrieve it.
downloadbtn.setUserData(filelist2.get(index).getName());
downloadbtn.setOnAction(new EventHandler() {
@Override
public void handle(ActionEvent arg0) {
System.out.println(downloadbtn.getUserData());
}