/** _more_ */ public void checkPattern() { String pattern = getPatternWidget().getText().trim(); File dir = new File(getFilePathWidget().getText().trim()); File[] list = dir.listFiles( (java.io.FileFilter) new PatternFileFilter(pattern, false, getHiddenWidget().isSelected())); StringBuffer sb = new StringBuffer("<html>"); if ((list == null) || (list.length == 0)) { sb.append("<h3><center><font color=\"red\">No files match the pattern</font></center></h3>"); sb.append("Pattern: " + pattern + "<br>"); list = dir.listFiles(); if (list != null) { for (int i = 0; i < list.length; i++) { if (i == 0) { sb.append("<hr>Example Files:<br>"); } if (i > 20) { sb.append(" ...<br>\n"); break; } sb.append(" " + list[i] + "<br>\n"); } } } else { for (int i = 0; i < list.length; i++) { if (i == 0) { sb.append("<h3><center>Files that match</center></h3>\n"); } if (i > 20) { sb.append(" ...<br>\n"); break; } sb.append(" " + list[i] + "<br>\n"); } } sb.append("</html>"); GuiUtils.showDialog("Sample files", GuiUtils.inset(new JLabel(sb.toString()), 5)); }