public void actionPerformed(ActionEvent e) {
	result = new StringBuilder();
	try {
	    String patternText = patternMatcher.patternText();
	    MatcherPreferences.storePatternText(patternText);
	    final List<String> testStringTexts = patternMatcher
		    .testStringTexts();
	    for (int i = 0, n = testStringTexts.size(); i < n; i++) {
		String testStringText = testStringTexts.get(i);
		if (testStringText.trim().isEmpty()) {
		    MatcherPreferences.removeTestStringText(i);
		    continue;
		}
		MatcherPreferences.storeTestStringText(i, testStringText);
		Pattern compiledPattern = Pattern.compile(patternText);
		Matcher matcher = compiledPattern.matcher(testStringText);
		String resultLabel = "Field "
			+ (i + 1)
			+ ": "
			+ testStringText.substring(0,
				Math.min(testStringText.length(), 20))
			+ (testStringText.length() >= 20 ? "..." : "");
		result.append("--- matches() for " + resultLabel + " ---\n");
		if (!matcher.matches()) {
		    result.append("string does not match regex\n");
		} else {
		    appendMatchedGroups(matcher);
		}
		Matcher matcher2 = compiledPattern.matcher(testStringText);
		result.append("\n--- find() for " + resultLabel + " ---\n");
		boolean find = matcher2.find();
		if (!find) {
		    result.append("no matches found\n");
		}
		int iteration = 1;
		do {
		    if (find) {
			result.append("Iteration " + iteration++ + ":\n");
			appendMatchedGroups(matcher2);
			result.append("\n");
		    }
		} while (find = matcher2.find());
		result.append("\n");
	    }
	    PatternMatcher r = this.patternMatcher;
	    this.patternMatcher.result.setRows(TextComponentUtilities
		    .estimatedRows(this.patternMatcher.result));
	    showResult();
	} catch (Exception ex) {
	    JTextArea textarea = new JTextArea(ex.getMessage());
	    textarea.setFont(new Font("Monospaced", Font.PLAIN, 16));
	    JOptionPane.showMessageDialog(this.patternMatcher, textarea, ex
		    .getClass().getName(), JOptionPane.ERROR_MESSAGE);
	}
    }