Login  Register

Alter dialog fields with DialogListener

Posted by Michael Doube on Apr 01, 2010; 1:20pm
URL: http://imagej.273.s1.nabble.com/Alter-dialog-fields-with-DialogListener-tp3688687.html

Hi all

I'm having a go at writing a dialog that responds to input by changing
the the numbers and text it's displaying, which are then assigned to
variables after OK is hit and gd.getNextNumber() etc. are called.

Specifically I want the user to identify whether a particular state is
true (their images are or are not Hounsfield unit calibrated) and
(un)tick a checkbox, then enter thresholds based on HU calibrated or raw
values.

So, the values that have to change are the ones in the threshold boxes:

gd.addNumericField("Bone Min:", this.min, 0, 6, pixUnits);

this.min would change from the raw value to the calibrated value and
pixUnits would change from "grey" to "HU".

I had a go writing this with a DialogListener, using
ij.plugin.SpecifyROI.java as an example, but have not been able to get
my dialog box to update when the HU box is ticked.

Any ideas or pointers to examples are welcome,

Michael