private void removeSectionClicked() {
        Object[] sectionIDs = new Object[sections.size()];
        for(int i = 1; i <= sectionIDs.length; i++){
            sectionIDs[i-1] = sections.get(i-1).getSectionNumber();
        }

        Object answer = JOptionPane.showInputDialog(frame,
                "Which section do you want to remove?",
                "Remove Section",
                JOptionPane.PLAIN_MESSAGE,
                null,
                sectionIDs,
                sectionIDs[0]);

        if(answer == null){
            return;
        }
        int removedSectionID = (Integer)answer;

        RecipeSectionPanel removedSection = null;
        List<RecipeSectionPanel> newSections = new LinkedList<>();
        for(RecipeSectionPanel panel : sections){
            if(panel.getSectionNumber() == removedSectionID){
                removedSection = panel;
            } else {
                newSections.add(panel);
                panel.setSectionNumber(newSections.indexOf(panel) + 1);
            }
        }

        mainPanel.remove(removedSection);
        sections = newSections;

        mainPanel.updateUI();
        Dimension dim = frame.getSize();
        frame.setPreferredSize(dim);
        frame.pack();

        changed();
    }