次のスクリプトは、2 x 4 の長方形の領域を出力し、setValue で幅と高さをリセットして新しいサイズを出力します。
Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myProperty As JavaProperty
Dim myObject As JavaObject
Set mySession = new JavaSession()
' setProperty on custom class
Set myClass = _
mySession.GetClass("valid5/javaconn/java/Rectangle;")
Set myObject = myClass.CreateObject("(II)V", 2,4)
Print "The area of our Rectangle (2 X 4) is " & _
myObject.getArea()
Set myProperty = myClass.GetProperty("width")
Call myProperty.setValue(5,o)
Set myProperty = myClass.GetProperty("height")
Call myProperty.setValue(10,o)
Print "The area of our Rectangle (5 X 10) is " & _
myObject.getArea()