public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
		format = gd.getNextChoiceIndex();
		start = Tools.parseDouble(gd.getNextString());
 		String str = gd.getNextString();
 		interval = Tools.parseDouble(str);
		x = (int)gd.getNextNumber();
		y = (int)gd.getNextNumber();
		fontSize = (int)gd.getNextNumber();
		text = gd.getNextString();
		double[] range = getRange(gd, 1, defaultLastFrame);
		useOverlay = gd.getNextBoolean();
		useTextToolFont = gd.getNextBoolean();
		if (virtualStack) useOverlay = true;
		firstFrame=(int)range[0]; lastFrame=(int)range[1];
		int index = str.indexOf(".");
		if (index!=-1)
			decimalPlaces = str.length()-index-1;
		else
			decimalPlaces = 0;
		if (gd.invalidNumber()) return false;
		if (useTextToolFont)
			font = new Font(TextRoi.getFont(), TextRoi.getStyle(), fontSize);
		else
			font = new Font("SansSerif", Font.PLAIN, fontSize);
		if (y<fontSize) y = fontSize+5;
		ImageProcessor ip = imp.getProcessor();
		ip.setFont(font);
		int size = defaultLastFrame;
		maxWidth = ip.getStringWidth(getString(size, interval, format));
		fieldWidth = 1;
		if (size>=10) fieldWidth = 2;
		if (size>=100) fieldWidth = 3;
		if (size>=1000) fieldWidth = 4;
		if (size>=10000) fieldWidth = 5;
		Prefs.set("label.format", format);
        return true;
    }