Hi,
I am working on an Application to list Filenames from a Folder into my ListView.
And I wondered: "How can I sort the Filenames inside the ListView by drag and dropping.
Could you help me with this?
I am working on an Application to list Filenames from a Folder into my ListView.
And I wondered: "How can I sort the Filenames inside the ListView by drag and dropping.
Could you help me with this?
Java:
public class CombinerFXMLController {
@FXML
ListView FileList;
ObservableList elements;
@FXML
public void initialize(){
elements= FXCollections.observableArrayList();
FileCombiner combiner=new FileCombiner();
for(int i=0;i<combiner.getPaths().size();i++){
Path p=combiner.getPaths().get(i).getFileName();
elements.add(p);
}
FileList.setPrefWidth(200);
FileList.setItems(elements);
}
public void Combine(ActionEvent actionEvent) {
}
private class PDFileCells extends ListCell<String>{
public PDFileCells() {
ListCell thisCell=this;
setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
setAlignment(Pos.CENTER);
setOnDragDetected(event -> {
if (getItem() == null) {
return;
}
});
}
}
}
//The Combiner class is just an array List containing the Paths