79090917

Date: 2024-10-15 16:40:29
Score: 0.5
Natty:
Report link

This answer is based on @sdidsa suggestion:

    tbInventarioView.setRowFactory(tv -> {
        TableRow<Inventario> row = new TableRow<>(){
        @Override
        protected void updateItem(Inventario item, boolean empty) {
            super.updateItem(item, empty);
            if (item == null || item.getFlAtivo() == false) {
                setStyle("");
            } else if (item.getFlAtivo()) {
                setStyle("-fx-text-background-color: blue;");
            } else {
                setStyle("");
            }
        }};         
        row.setOnMouseClicked(event -> {
            if (event.getClickCount() == 2 && (!row.isEmpty())) {
                Inventario rowData = row.getItem();
                doubleClickShow(rowData);
            }
        });
        return row;
    });
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @sdidsa
  • Low reputation (0.5):
Posted by: Gilberto