Skip to content

Cancelling the "Add Volunteer" quits the whole system, instead of returning to the main menu #48

@matxpg

Description

@matxpg

Under MainMenu.java

private void addVolunteerButtonActionPerformed(java.awt.event.ActionEvent evt)     {                                                   
{                                         

            this.setVisible(false);
            this.dispose();
            VolunteerForm volunteerForm = new VolunteerForm(theScript, database);
            volunteerForm.setVisible(true);
            this.repaint();
}                       // TODO add your handling code here:
}                

the original main menu is disposed of when you click add volunteer,

Under VolunteerForm.java:293-296

private void cancelActionPerformed(java.awt.event.ActionEvent evt) {                                       
    setVisible(false); //you can't see me!
    dispose(); //Destroy the JFrame object
}             

but the volunteer form is disposed of when you click cancel, it doesn't just return to a main menu because that menu was disposed of.
-A fix could be initializing a MainMenu with the original script / database

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions