private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed
// TODO add your handling code here:
    try {
        int d = jList3.getSelectedIndex();
        int e = jList3.getLastVisibleIndex();
        int f = jList3.getFirstVisibleIndex();

        int i = jList3.getSelectedIndex();

        v2.add(jList3.getSelectedValue().toString());
        v1.remove(jList3.getSelectedValue().toString());

        jList3.setListData(v1);
        jList1.setListData(v2);
        jList1.setSelectedIndex(0);
        if (v1.isEmpty()) {
            btnRemove.setEnabled(false);
        } else if (d == f) {
            jList3.setSelectedIndex(f);
        } else if (d > f && d < e) {
            jList3.setSelectedIndex(d);
        } else if (d == e) {
            jList3.setSelectedIndex(e - 1);
        }
        if (!v2.isEmpty()) {
            jButton1.setEnabled(true);
        }
    } catch (NullPointerException e) {
    }
}//GEN-LAST:event_btnRemoveActionPerformed