// background thread, otherwise the GUI would wait and the progress bar would not be
// displayed properly
SwingWorker worker = new SwingWorker<String, Object>() {
protected String doInBackground() throws Exception {
// For shapefiles with many features its nice to display a progress bar
final JProgressWindow progress = new JProgressWindow(null);
progress.setTitle("Validating feature geometry");
int numInvalid = validateFeatureGeometry(progress);
if (numInvalid == 0) {
return "All feature geometries are valid";
} else {