Example: setValue method

This script prints the area of a 2 X 4 rectangle then, with setValue, resets the width and height and prints the new size.

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()