@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==jb1){
			//上移
			//先获得选择项的索引
			int index = list.getSelectedIndex();
			if(index!=-1){
				if(index > 0){
					System.out.println(model.getSize()+" index="+index);
					//再把当前选择项的值赋给上一个索引处的值
					model.set(index-1, cli[index]);
					//然后把上一个索引处的值赋个当前索引处
					model.set(index,cli[index-1]);
					//重新构造列表模型
					list.setModel(model);
					//把改变后的模型赋给数组cli,该步必不可少
					model.copyInto(cli);
					//最后设置选择项为选中状态
					list.setSelectedIndex(index-1);
				}else{
					JOptionPane.showMessageDialog(null, "已移动到最顶部了", "信息提示", JOptionPane.INFORMATION_MESSAGE);
				}
			}else{
				JOptionPane.showMessageDialog(null, "请先选择要移动的项", "信息提示", JOptionPane.INFORMATION_MESSAGE);
			}
			
			
		}else if(e.getSource()==jb2){
			//下移
			//先获得选择项的索引
			int index = list.getSelectedIndex();
			if(index!=-1){
				if(index < model.getSize()-1){
					System.out.println(model.getSize()+" index="+index);
					//再把当前选择项的值赋给下一个索引处的值
					model.set(index+1, cli[index]);
					//然后把下一个索引处的值赋个当前索引处
					model.set(index,cli[index+1]);
					//重新构造列表模型
					list.setModel(model);
					//把改变后的模型赋给数组cli,该步必不可少
					model.copyInto(cli);
					//最后设置选择项为选中状态
					list.setSelectedIndex(index+1);
				}else{
					JOptionPane.showMessageDialog(null, "已移动到最底部了", "信息提示", JOptionPane.INFORMATION_MESSAGE);
				}
			}else{
				JOptionPane.showMessageDialog(null, "请先选择要移动的项", "信息提示", JOptionPane.INFORMATION_MESSAGE);
			}
			
		}else if(e.getSource()==jb3){
			//获取选中的值
			CheckListItem item ;
			for(int i=0;i<model.getSize();i++){
				item = (CheckListItem) list.getModel().getElementAt(i);
				if(item.isSelected()){
					System.out.println(item);
				}
			}// for end
		}//if end 
	}// action end

}
	
// Represents items in the list that can be selected

class CheckListItem {
    private String label;
    private boolean isSelected = false;
    public CheckListItem(String label) {
        this.label = label;
    }
    public boolean isSelected() {
        return isSelected;
    }
    public void setSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }
    public String toString() {
        return label;
    }
}
class Mytree extends JTree implements ListCellRenderer{

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		// TODO Auto-generated method stub
		setEnabled(list.isEnabled());
		setName(value.toString());
		return this;
	}
	
}
// Handles rendering cells in the list using a check box
class CheckListRenderer extends JCheckBox implements ListCellRenderer {

    public Component getListCellRendererComponent(JList list, Object value,

            int index, boolean isSelected, boolean hasFocus) {
    	
        setEnabled(list.isEnabled());
        setSelected(((CheckListItem) value).isSelected());
        setFont(list.getFont());
        if (isSelected) {
            this.setBackground(list.getSelectionBackground());
            this.setForeground(list.getSelectionForeground());
        } else {
            this.setBackground(list.getBackground());
            this.setForeground(list.getForeground());
        }
        setText(value.toString());
        return this;

    }