There is a SplitPane in which I have inserted the TableView. And there are some questions.
1. TableView should adapt to different types of objects (currently 3, I plan more). After switching to one of the tabs in the TreeView, the previous one is generated and the new table is generated on the same TableView. Is this a good decision or is it possible to somehow improve / change it?
2. Coloring lines. I want to fill the lines with the color of only the table that corresponds to only one of my objects. But the "dye" goes to each table and constantly generates an exception of incompatibility of objects. Maybe I make a mistake when implementing a dye?
tableView.setRowFactory(rows -> new TableRow<MyClass>() { @Override protected void updateItem(MyClass item, boolean empty) { TreeItem<String> nValue = (TreeItem<String>) treeView.getSelectionModel().getSelectedItem(); if (nValue.getValue().equals("String")) { if (item != null) { if (!item.isActive()) { setStyle("-fx-background-color: darkorange; -fx-text-background-color: black;"); } else { setStyle("-fx-background-color: white; -fx-text-background-color: black;"); } } } super.updateItem(item, empty); } }); 3. All the same dye. In theory, it should change the color of the line when you click on it (because item.isActive changes its value when pressed), but this does not happen. and I do not understand a little why this is happening. What is wrong here?