A
A
Andrey Kostyaev2018-06-11 13:43:57
JavaFX
Andrey Kostyaev, 2018-06-11 13:43:57

TableView, problem with TableColumn, what could be the problem?

In the application I have a TableView with three columns, below is the screenshot
5b1e50ebce8cd518253521.png
The data is passed using :

ObservableList<Dox> doxData = FXCollections.observableArrayList()

Here is the declaration of the table and columns:
@FXML
  private TableView<Dox> doxTable;
  @FXML
  private TableColumn<Dox, LocalDate> dateColumn;
  @FXML 
  private TableColumn<Dox, Double> moneyColumn;
  @FXML
  private TableColumn<Dox, String> descriptionColumn;

Here is the code that determines what values ​​the columns have and sets doxData for the TableView:
dateColumn.setCellValueFactory(new PropertyValueFactory<>("date"));
moneyColumn.setCellValueFactory(new PropertyValueFactory<>("money"));
descriptionColumn.setCellValueFactory(new PropertyValueFactory<>("description"));
doxTable.setItems(doxData);

The question is why the values ​​​​are not displayed in the description, in theory everything should work, it does not give any errors. I tried to output the value of the description from doxData to the console, it displays everything, namely, it is not displayed in the table.
PS Here are the variables in the Dox class:
private LocalDate date;
private Double money;
private String description;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question