Subj : Question about accessing JavaBean Properties To : netscape.public.mozilla.jseng From : alanwli Date : Mon Oct 04 2004 11:59 am I have a simple JavaBean class: public class MyObj { public String getProperty1() { return "blah"; } } And I have a simple JavaScript that accesses the JavaBean property: importClass( Packages.MyObj ) o = new MyObj() print( o.property1 ) print( o["property1"] ) print( o[0] ) When I try to run the JavaScript, I get the following output: $ java -cp ".;$CLASSPATH" org.mozilla.javascript.tools.shell.Main test1.js blah blah js: "C:\cygwin\home\ali\javascript\test1.js", line 6: Java class "MyObj" has no public instance field or method named "0" Is there any way for me to have print( o[0] ) actually print "blah"? .