private void activityListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_activityListValueChanged

        int indx = activityList.getSelectedIndex() - 1;
        if (indx + 1 == oldIndx) {
            return;
        }

        //System.out.println(editingAct);

        transferChanges(false);
        //System.out.println(editingAct);

        int n = 0;
        //see if updated
        if (!activityNameBox.getText().equals("")
                && (editingAct != null
                && !editingAct.equals(original))) {
            //System.out.println(editingAct);
            //System.out.println(original);
            //request confirmation of swtiching with unwritten changes
            //System.out.println("switch from changes");
            //all done
            n = confirmDiscard();
        }

        if (n == 0) {
            if (indx == -1) {
                editingAct = new Activity(manager.getUId(), null,
                        0, false, null, null, null,
                        0, 0, 0, 0);

                original = (Activity) editingAct.clone();
            } else if (indx >= 0) {
                //&& !editingAct.getName().equals(getActivityNames[indx])) {
                original = manager.getActivity(activityNames[indx + 1]);
                editingAct = (Activity) original.clone();
            }
            //System.out.println("editset: " + editingAct.getWeight());

            //System.out.println("lst_precall " + indx);
            oldIndx = indx + 1;
            setFields();
            successLabel.setVisible(false);
        } else {
            activityList.setSelectedIndex(oldIndx);
        }
    }//GEN-LAST:event_activityListValueChanged