sort tableview with drag and drop (rows)

后端 未结 3 1094
天命终不由人
天命终不由人 2020-12-14 23:42

my aim is to sort a tableview with drag and drop. I followed this example: http://docs.oracle.com/javafx/2/fxml_get_started/fxml_tutorial_intermediate.htm

For drag a

3条回答
  •  感动是毒
    2020-12-14 23:53

    working the 1 answer (from James_D) into FMXL:

    public class FXMLTableViewController implements Initializable {
        private static final DataFormat SERIALIZED_MIME_TYPE = new DataFormat("application/x-java-serialized-object");
    
        @Override
        public void initialize(URL url, ResourceBundle resourceBundle) {
            tableView.setRowFactory(tv -> {
            ...
                return row ;
            });
        }
    
        @FXML
        private TableView tableView;
        ...
    

提交回复
热议问题