本文介绍了JCombobox箭头消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当未使用构造方法填充方法中的填充组合框时,组合框的箭头消失.

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

我尝试使用invokeLater方法,但是没有用.

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())));
    }
}

推荐答案

我遇到了同样的问题,当我使用方法removeAllComponents()方法而不是removeAll()方法

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

这篇关于JCombobox箭头消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 12:27