Combobox clearing value issue

前端 未结 8 2590
逝去的感伤
逝去的感伤 2020-12-15 06:00

I\'ve stumbled on an issue with Comboboxes in javafx2.2. This is the scenario:

  • Users click on the \'editFile\' button.
  • Another pane becomes visible (w
相关标签:
8条回答
  • 2020-12-15 06:29

    I've just tested a working solution with the Java JDK 1.7.11:

    combobox.setSelectedItem(null);
    combobox.setValue(null);
    

    Hope it helps :)

    0 讨论(0)
  • 2020-12-15 06:31

    I had the same problem with a ComboBox. The buttonCell of the ComboBox is not updated correctly when I change the items of the ComboBox. This looks like a graphics bug.

    I use direct manipulation of buttonCell field in ComboBox.

    combo.getButtonCell().setText("");
    combo.getButtonCell().setItem(null);
    

    This is the best solution I've found without recreate the ComboBox.

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