K
K
kirawa2016-03-25 13:02:06
Java
kirawa, 2016-03-25 13:02:06

How to name an element in such a list?

for (File file : getFiles(dir1,"Autoload")) {
            listView.getItems().add(new EntitiesFiles(file.getName(),false));
            
        }

        listView.setCellFactory(CheckBoxListCell.forListView(new Callback<EntitiesFiles, ObservableValue<Boolean>>() {
            @Override
            public ObservableValue<Boolean> call(EntitiesFiles item) {
                observable = new SimpleBooleanProperty();
                observable.addListener(new ChangeListener<Boolean>() {
                    @Override
                    public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
                        if (newValue){
                            System.out.println(newValue +"  true");
                        }else {
                            System.out.println(newValue +"  false");
                        }
                    }
                });
                return observable;
            }
        }));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Yakupov, 2016-04-08
@DeeplessHole

Maybe,

listView.getItems().get(elemNumber).name = "newName";
?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question