JList Listener找不到符号

时间:2013-05-02 04:59:24

标签: java swing jlist

尝试添加LIstSelectionListener并不断获取错误找不到符号ListSelectionListener() ^ 符号类ListSelectionListener

jlstExtras.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            int[] indices = jlstExtras.getSelectedIndices();

            int i;
            for( i = 0; i < indices.length; i++){
                if(indices[i] == 0)
                    delivery = 4.00;
                else if (indices[i] == 1)
                    tip = .15;
                else if (indices[i] == 2)
                    tip = .20;

            }       

        }
    });

错误出现在第一行(新的ListSelectionListener()

0 个答案:

没有答案