private void spinner_y2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinner_y2StateChanged
    if(hitbox_index_selected!=-1 || click_target_flag)
    {
        click_target_flag=true;
        if(hitbox_index_selected!=-1)
        {
            int i=0;
            for(Node hitboxes_node=current_frame.getFirstChild();hitboxes_node!=null;hitboxes_node=hitboxes_node.getNextSibling())//Hitbox loop
            {
                if(hitboxes_node.getNodeName().equals("Hitboxes"))
                {
                    if(((Element)hitboxes_node).getAttribute("variable").equals(hitbox_color_selected))
                    {
                        for(Node hitbox=hitboxes_node.getFirstChild();hitbox!=null;hitbox=hitbox.getNextSibling())//Red Hitboxes loop
                        {
                            if(hitbox.getNodeName().equals("Hitbox"))
                            {
                                if(i==hitbox_index_selected)
                                    ((Element)hitbox).setAttribute("y2", ""+spinner_y2.getValue());
                                i++;
                            }
                        }
                    }
                }
            }

            updateHitboxes(current_frame);
        }
    }else
    {
        JOptionPane.showMessageDialog(null, "Select a hitbox first.", "Be careful", JOptionPane.INFORMATION_MESSAGE);
    }
}//GEN-LAST:event_spinner_y2StateChanged