0

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);
Yehia Hesham
  • 13
  • 1
  • 5
  • As far as I know the `FileChooser` is an OS component, so sorting is done via operating system behavior. So I am afraid this will not be possible.. – eckig Feb 02 '15 at 13:42
  • 1
    What do you mean by "follow the listview indexes"? From your code it looks like you are replacing all the items in the listview anyway. I guess I'm asking if you can clarify the order in which you want the items to appear. – James_D Feb 02 '15 at 14:01

0 Answers0