i am trying to sync the indexes of a Listview and a list of type File. I am having problems when i try to add two elements once at a time. the Problem is caused by the Filechooser since it automatically sort the pre-existing files and the new selected files according to their names and the Listview doesn't sort. And that where the problem happens!. I would like to keep the list of files follow the Listview indexes ! So how can i disable /filter the selected files to be NOT sorted internally ? and thanks . here is the code:
Stage arg0 = null;
FileChooser fileChooser = new FileChooser();
selectedFiles = fileChooser.showOpenMultipleDialog(arg0);
for(int j=0;j<selectedFiles.size();j++)
selectedFiles_names.add(selectedFiles.get(j).getName());
listviewadder=FXCollections.observableArrayList(selectedFiles_names);
playlist.setItems(listviewadder);