javaobject.field read or write an instance field
Each JavaObject object contains properties that have the same names as the public instance fields and methods (but not the static or class fields and methods) of the Java object it represents. These properties allow you to read and write the value of public fields. The properties of a given JavaObject object obviously depend on the type of Java object it represents. You can use the for/in loop to enumerate the properties of any given JavaObject.
java.awt.Rectangle is a JavaClass that represents the java.awt.Rectangle class. We can create a JavaObject that represents an instance of this class like this:
var r = new java.awt.Rectangle(0,0,4,5);
var perimeter = 2*r.width + 2*r.height;
r.width = perimeter/4; r.height = perimeter/4;