swing页面中第一个下拉框输入要个第二个级联怎么做

解决方案 »

  1.   

    private JComboBox  areacmb = new JComboBox();//
    private JComboBox  childareacmb = new JComboBox();//
    areacmb.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent arg0) {
                // TODO Auto-generated method stub
                    int index = areacmb.getSelectedIndex();
                    initialchildareaComBox(index);//往childareacmb里塞item
                }
               });