JCombobox arrow disappears

强颜欢笑 提交于 2019-12-23 13:24:22

问题


When the fill combobox in a method which is not placed in the constructor, the arrow of combobox disappears.

I tried with the invokeLater method, but it did not work.

private void fillProduct(){
    this.VALID_FOR_PRODUCT.removeAllItems();
    this.VALID_FOR_PRODUCT.addItem(new JChooseItem("ALL", "Any"));
    for(Product product : Product.values()){
        this.VALID_FOR_PRODUCT.addItem(new JChooseItem(product.getName(), langHelper.getTrans(product.getTranslationKey())));
    }
}

回答1:


I had the same issue, it happened when I used method removeAllComponents() method instead of removeAll() method



来源:https://stackoverflow.com/questions/51949890/jcombobox-arrow-disappears

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!