private void editSpecialAbilityDialog(SpecialAbility specialAbility) {
        JLabel nameLabel = new JLabel("Name");
        nameLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

        JTextField nameField = new JTextField(specialAbility.getName());
        nameField.setAlignmentX(Component.LEFT_ALIGNMENT);

        JLabel descLabel = new JLabel("Description");
        descLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

        JTextArea descField = new JTextArea(specialAbility.getDescription());
        descField.setColumns(40);
        descField.setRows(30);
        descField.setLineWrap(true);
        descField.setAlignmentX(Component.LEFT_ALIGNMENT);

        JPanel panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
        panel.add(nameLabel);
        panel.add(nameField);
        panel.add(descLabel);
        panel.add(descField);

        boolean showAgain = true;
        do {
            int option = JOptionPane.showConfirmDialog(null, panel, "Edit Special Ability", JOptionPane.OK_CANCEL_OPTION);
            if (option == JOptionPane.OK_OPTION) {
                String newName = nameField.getText();
                String newDesc = descField.getText();

                SpecialAbility newSpecialAbility = new SpecialAbility();
                newSpecialAbility.setName(newName);

                if (newDesc == null || newDesc.equals("")) {
                    newSpecialAbility.setDescription("No description provided.");
                } else {
                    newSpecialAbility.setDescription(newDesc);
                }

                if (newSpecialAbility.getName() == null || newSpecialAbility.getName().equals("")) {
                    JOptionPane.showMessageDialog(this.getTopLevelAncestor(), "Special ability must have a name.", "Error", JOptionPane.ERROR_MESSAGE);
                } else if (specialAbilities.contains(newSpecialAbility)) {
                    JOptionPane.showMessageDialog(this.getTopLevelAncestor(), "Special ability must have a unique name.", "Error", JOptionPane.ERROR_MESSAGE);
                } else {
                    specialAbilities.add(newSpecialAbility);
                    updateParent();
                    showAgain = false;
                }
            } else {
                showAgain = false;
            }
        } while (showAgain);
    }