JComboBox按钮监听异常


JComboBox<String> choice = new JComboBox<String>();
        choice.setBounds(20, 1, 81, 21);
        choice.setFont(new Font("微软雅黑 Light", Font.PLAIN, 13));
        choice.addItem("ID");
        choice.addItem("商品名称");
        frm_drop.getContentPane().add(choice);
        choice.addItemListener(new ItemListener(){
            public void itemStateChanged(ItemEvent e) {
                Choice choice = (Choice) e.getItemSelectable();
                switch (choice.getSelectedItem()) {
                    case "ID":
                        
                        break;
                    case "商品名称":
                        
                        break;
                    default:
                        break;
                }
            }
        });

img


我想要不同按钮实现不同事情,但我这些方法好像是choice的,我用choice就没问题,但是choice显示不了中文,我想按id就按照id搜索,按名称,就按照名称搜索,咋办

组件使用错误的,JComboBox是javafx中的组件,而Choice你导入的包是java.awt中的