0

I try to make an editable table. But I don't know how to edit integer column. These codes I used are fine to work on String column.

Name.setCellValueFactory(new PropertyValueFactory<Table, String>("Name"));
    Name.setCellFactory(TextFieldTableCell.forTableColumn());

    Name.setOnEditCommit(
            (TableColumn.CellEditEvent<Table, String> t) ->
                ( t.getTableView().getItems().get(
                        t.getTablePosition().getRow())
                ).setName(t.getNewValue())
            );
1
  • Please be more specific on what is not working! Are there any exceptions ? Commented Dec 19, 2016 at 9:12

1 Answer 1

2

you need to set the proper cellFactory:

    integerColumn.setCellFactory(TextFieldTableCell.forTableColumn(new IntegerStringConverter()));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.