Javafx TreeTableView with HashMap values

329 views Asked by At

It is relatively easy to populate a javafx treetableview column this kind of code: nameColumn.setCellValueFactory(new TreeItemPropertyValueFactory<>("name")); This way, the column nameColumn can be linked to the underlying datatype with the field "name". This is of cource good if there can only be a limited amount of different fields, but imagine that for each row in the treetableview, there is a hashmap (or something similar) that stores additional information.

Said hashmap would contain the information for all columns in the row. This means that the hashmap would have keys and values for all the keys with the same name as the columns in the javafx treetableview. For example, the hashmap would have the information otherwise stored in the fields name, time and price for example.

Is there a way to achieve this behavior within java and the javafx treetableview? How? Any help is appreciated as it would enable a lot more modular system for me. Thank's in advance.

0

There are 0 answers