Login  Register

Re: Alter dialog fields with DialogListener

Posted by Michael Schmid on Apr 01, 2010; 6:44pm
URL: http://imagej.273.s1.nabble.com/Alter-dialog-fields-with-DialogListener-tp3688687p3688690.html

Hi Michael,

changing the contents of the numeric field is not so difficult as it  
may seem, see the Fast_Filters for an example. There the x radius and  
y radius fields are synchronized if a checkbox is on.
   http://imagejdocu.tudor.lu/doku.php?
id=plugin:filter:fast_filters:start

For the units - hm, I fear that this will be more complicated. In  
GenericDialog you can get no reference to the Label where the units  
are displayed. You would have to iterate through the components of  
the GenericDialog (gd.getComponents(), a method of the Container  
class) and find the correct one (maybe it is the one after the  
TextField that you want to modify, but I am not sure).

Michael
________________________________________________________________

On 1 Apr 2010, at 19:57, Michael Doube wrote:

> Thanks for your response Michael.  Looks complicated; I'll have a go
> this evening.
>
>> as far as I understand it you want to change the text in a numeric
>> field after the dialog has been displayed?
>
> Yes, and also the units to the right of the numeric field.  But I can
> deal with each of these issues one at a time...
>
>
> Michael