JavaFX: How to change content CSS properties in ComboBox for text?

29 Views Asked by At

The problem is that when you first click on the combobox, the text in it is displayed with a downward shift, but with further manipulations everything is fine. Moreover, if the cell has already been clicked previously, when clicked again, everything is fine too. Please tell me what could be the problem? my problem in image

The dropdown list is in a table cell, but judging by the dropdown arrow, it is positioned correctly in the cell.

.table-view .cell .text-field,
.cell .combo-box,
.cell .text-field:hover,
.cell .combo-box:hover,
.cell .text-field:focused,
.cell .combo-box:focused{
    -fx-alignment: center;
    -fx-border-color: transparent;
    -fx-background-color: transparent;
    -fx-border-insets: 0;
    -fx-content-display: center;
}

.table-view .cell .combo-box .list-view{
    -fx-background-color: -primary-color;
    -fx-translate-y: 10px;
}
.table-view .cell .combo-box > .cell{
    -fx-alignment: center;
    -fx-border-insets: 0;
}
0

There are 0 best solutions below