@Override
    public Component getListCellRendererComponent(
                                       JList list,
                                       Object value,
                                       int index,
                                       boolean isSelected,
                                       boolean cellHasFocus) {
        //Get the selected index. (The index param isn't
        //always valid, so just use the value.)
        String selectedIndex = (String) value;

        if (isSelected) {
            setBackground(list.getSelectionBackground());
            setForeground(list.getSelectionForeground());
        } else {
            setBackground(list.getBackground());
            setForeground(list.getForeground());
        }

        //Set the icon and text.  If icon was null, say so.
        ImageIcon icon;
        String pet;
        Spell.passives.get(index).unlock();
        if (Spell.passives.get(index).locked)
        {
            icon=Spell.lockedImage;
            pet = "UNLOCKED AT "+Spell.passives.get(index).unlockXP+" XP";
            if (isSelected)
            jList1.setSelectedIndex(0);
        }
        else
        {
            pet = names.get(index);
            icon = images.get(index);
        }
        
        setIcon(icon);
        if (icon != null) {
            setText(pet);
            setFont(list.getFont());
            this.setToolTipText(tips.get(index));
        } else {
            setText("ERROR");
        }

        return this;
    }