I have a column that contains java.sql.Date and I want it to put nulls at the bottom in ascending order:
Right now, they end up on top.
followupCol.setCellFactory((TableColumn<DisabilityCase, Date> p) ->
{
TableCell<DisabilityCase, Date> cell = new TableCell<DisabilityCase, Date>()
{
@Override
protected void updateItem(Date item, boolean empty)
{
super.updateItem(item, empty);
if (item == null || empty)
{
setText(null);
} else
{
if (!LocalDate.now().isBefore(item.toLocalDate()))
{
setTextFill(Color.RED);
} else
{
setTextFill(Color.BLACK);
}
setText(new SimpleDateFormat(DATE_FORMAT).format(item));
}
}
};
return cell;
});
