JavaFX ComboBox Image

后端 未结 1 464
不思量自难忘°
不思量自难忘° 2020-12-19 21:03

I am trying to create a ComboBox that will display a preview of selected Image, but the ComboBox displays the string value instead.

1条回答
  •  感动是毒
    2020-12-19 22:05

    You can specify the buttonCellProperty of the ComboBox:

    comboBox.setButtonCell(new StatusListCell());
    

    The button cell is used to render what is shown in the ComboBox 'button' area.

    0 讨论(0)
提交回复
热议问题