private void notifyListeners(AWTEvent e) {
        if (dialogListeners == null) return;
        boolean everythingOk = true;
        for (int i=0; everythingOk && i<dialogListeners.size(); i++)
            try {
                resetCounters();
                if (!((DialogListener)dialogListeners.elementAt(i)).dialogItemChanged(this, e))
                    everythingOk = false; }         // disable further listeners if false (invalid parameters) returned
            catch (Exception err) {                 // for exceptions, don't cover the input by a window but
                IJ.beep();                          // show them at in the "Log"
                IJ.log("ERROR: "+err+"\nin DialogListener of "+dialogListeners.elementAt(i)+
                "\nat "+(err.getStackTrace()[0])+"\nfrom "+(err.getStackTrace()[1]));  //requires Java 1.4
            }
        boolean workaroundOSXbug = IJ.isMacOSX() && !okay.isEnabled() && everythingOk;
        if (previewCheckbox!=null)
            previewCheckbox.setEnabled(everythingOk);
        okay.setEnabled(everythingOk);
        if (workaroundOSXbug) repaint(); // OSX 10.4 bug delays update of enabled until the next input
    }