Javafx tableview滚动太慢了

时间:2016-06-17 05:58:12

标签: java javafx scroll tableview fxml

我在Javafx中制作了一个显示100.000行的Tableview,但问题是滚动速度太慢,如果有任何人对此有任何疑问,请...

bitbucket.org/JdevY/tableview-performance

//如果我创建readOnlyObjectWrapper(param.getValue())它会很好但是 我把它变成了readOnlyObjectWrapper(param.getValue()。getId_student)它不起作用!!

id_student.setCellValueFactory(new PropertyValueFactory<Student,String>("id_student") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getId_student());
        }

    });
    fname.setCellValueFactory(new PropertyValueFactory<Student, String>("fname") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getFname());
        }

    });
    lname.setCellValueFactory(new PropertyValueFactory<Student, String>("lname") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getLname());
        }

    });
    nameFather.setCellValueFactory(new PropertyValueFactory<Student, String>("nameFather") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getNameFather());
        }

    });
    birthDay.setCellValueFactory(new PropertyValueFactory<Student, String>("birthDay") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getBirthDay());
        }

    });
    birthPlace.setCellValueFactory(new PropertyValueFactory<Student, String>("birthPlace") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getBirthPlace());
        }

    });
    email.setCellValueFactory(new PropertyValueFactory<Student, String>("email") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getEmail());
        }

    });
    tel.setCellValueFactory(new PropertyValueFactory<Student, String>("tel") {
        @Override
        public ObservableValue<String> call(TableColumn.CellDataFeatures<Student, String> param) {
            return new ReadOnlyObjectWrapper(param.getValue().getTel());
        }

    });

0 个答案:

没有答案