try doing something like this.
Scriptable scope = cx.initStandardObjects();
// Use the Counter class to define a Counter constructor
// and prototype in JavaScript.
ScriptableObject.defineClass(scope, Counter.class);
// Create an instance of Counter and assign it to
// the top-level variable "myCounter". This is
// equivalent to the JavaScript code
// myCounter = new Counter(7);
Object[] arg = { new Integer(7) };
Scriptable myCounter = cx.newObject(scope, "Counter",
arg);
scope.put("c", scope, myCounter);
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino