Source:
protected JComponent getDialogContent() { final DCPanel formPanel = new DCPanel(); int row = 0; WidgetUtils.addToGridBag(DCLabel.bright("Dictionary name:"), formPanel, 0, row); WidgetUtils.addToGridBag(_nameTextField, formPanel, 1, row); row++; WidgetUtils.addToGridBag(DCLabel.bright("Values:"), formPanel, 0, row); WidgetUtils.addToGridBag(WidgetUtils.scrolleable(_valuesTextArea), formPanel, 1, row); row++; WidgetUtils.addToGridBag(_caseSensitiveCheckBox, formPanel, 1, row); final JButton createDictionaryButton = WidgetFactory.createPrimaryButton("Save dictionary", IconUtils.ACTION_SAVE_BRIGHT); createDictionaryButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String name = _nameTextField.getText(); if (StringUtils.isNullOrEmpty(name)) { JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the name of the dictionary"); return; } final String values = _valuesTextArea.getText(); if (StringUtils.isNullOrEmpty(values)) { JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the values"); return; } final boolean caseSensitive = _caseSensitiveCheckBox.isSelected(); SimpleDictionary dict = new SimpleDictionary(name, caseSensitive, values.split("\n")); if (_originalDictionary != null) { _catalog.removeDictionary(_originalDictionary); } _catalog.addDictionary(dict); SimpleDictionaryDialog.this.dispose(); } }); final DCPanel buttonPanel = DCPanel.flow(Alignment.CENTER, createDictionaryButton); final DescriptionLabel descriptionLabel = new DescriptionLabel( "A simple dictionary is a dictionary that you enter directly in DataCleaner. In the 'Values' field you can enter each value of the dictionary on a separate line."); final DCPanel mainPanel = new DCPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(descriptionLabel, BorderLayout.NORTH); mainPanel.add(formPanel, BorderLayout.CENTER); mainPanel.add(buttonPanel, BorderLayout.SOUTH); mainPanel.setPreferredSize(getDialogWidth(), 400); return mainPanel; }

Target:
protected JComponent getDialogContent() { final DCPanel formPanel = new DCPanel(); int row = 0; WidgetUtils.addToGridBag(DCLabel.bright("Dictionary name:"), formPanel, 0, row); WidgetUtils.addToGridBag(_nameTextField, formPanel, 1, row); row++; WidgetUtils.addToGridBag(DCLabel.bright("Values:"), formPanel, 0, row); WidgetUtils.addToGridBag(WidgetUtils.scrolleable(_valuesTextArea), formPanel, 1, row); row++; WidgetUtils.addToGridBag(_caseSensitiveCheckBox, formPanel, 1, row); final JButton createDictionaryButton = WidgetFactory.createPrimaryButton("Save dictionary", IconUtils.ACTION_SAVE_BRIGHT); createDictionaryButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String name = _nameTextField.getText(); if (StringUtils.isNullOrEmpty(name)) { JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the name of the dictionary"); return; } final String values = _valuesTextArea.getText(); if (StringUtils.isNullOrEmpty(values)) { JOptionPane.showMessageDialog(SimpleDictionaryDialog.this, "Please fill out the values"); return; } final boolean caseSensitive = _caseSensitiveCheckBox.isSelected(); final SimpleDictionary dict = new SimpleDictionary(name, caseSensitive, values.split("\n")); if (_originalDictionary != null) { _catalog.removeDictionary(_originalDictionary); } _catalog.addDictionary(dict); SimpleDictionaryDialog.this.dispose(); } }); final DCPanel buttonPanel = DCPanel.flow(Alignment.CENTER, createDictionaryButton); final DescriptionLabel descriptionLabel = new DescriptionLabel( "A simple dictionary is a dictionary that you enter directly in DataCleaner. In the 'Values' field you can enter each value of the dictionary on a separate line."); final DCPanel mainPanel = new DCPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(descriptionLabel, BorderLayout.NORTH); mainPanel.add(formPanel, BorderLayout.CENTER); mainPanel.add(buttonPanel, BorderLayout.SOUTH); mainPanel.setPreferredSize(getDialogWidth(), 400); return mainPanel; }