I am changing elements in a combo box dynamically. It works fine, except that the number of visible lines remains fixed according to the first mouse click.
Example. The combobox elements are set to A and B. When I click on the drop-down list, it shows 2 lines with A and B. Then I dynamically change objects to C, D and E. When I click on the combo box, it shows 2 lines with C and D and scroll bar.
I have already installed
comboBox.setVisibleRowCount(10);
but it shows only 2 lines and a scrollbar.
If I do the opposite, first set the elements to C, D and E and click on the combo box; it shows three visible lines. Then I dynamically change objects to A and B. When I click on the combo box, it shows 3 lines! A, B and empty string.
javafx combobox
Scarinio
source share