Reserved Attribute: varref
Description
This attribute is to obtain an object using the varriable reference.
Attribute Values
The attribute value should correspond to an variable name.
Additional Notes
idref,
varref, and
ctor are mutually exclusive attributes and should not be used together.
If the default variable lookup method is used, by default only public variables are readable. By setting the "defaultaccessible" or "accessible" property of CookXml to true, one can read private and protected variables as well, if there is no SecurityManager. Sandbox Java Web Start has a SecurityManager, so if you are going to run the application in a Sandbox Java Web Start, then do not set the accessible properties.
Examples
The following XML code retrieves a button from variable
okButton and set its text to "OK".
<button varref="okButton" text="OK"/>