import ij.*; import ij.process.*; import ij.gui.*; import java.awt.*; import ij.plugin.*; /** This plugin demonstrates how to use the GenericDialog.enableYesNoCance(yesLabel,noLabel) method, which was added in ImageJ 1.43c. */ public class Yes_No_Cancel_Demo implements PlugIn { public void run(String arg) { GenericDialog gd = new GenericDialog("YesNoCancel Demo"); gd.addMessage("This is a custom YesNoCancel dialog"); gd.enableYesNoCancel("Run batch", "Add another file"); gd.showDialog(); if (gd.wasCanceled()) IJ.log("The user clicked on the 'Cancel' button"); else if (gd.wasOKed()) IJ. log("The user clicked on the 'Yes' button"); else IJ. log("The user clicked on the 'No' button"); } }