|N||myJavaObject = document.applets[anIndex];|
|Object properties:||description, filename, length, name|
|Object methods:||booleanValue(), destroy(), disable(), doubleValue(), enable(), getAppletContext(), getAppletInfo(), getBackground(), getClass(), getCodeBase(), getDocumentBase(), getLocale(), getParameter(), getParameterInfo(), getToolkit(), hide(), init(), isActive(), isEnabled(), isShowing(), isValid(), isVisible(), minimumSize(), refresh(), start(), stop(), toString()|
To make any serious use of this object, you need to know a little Java - at least enough to be able to be familiar with the class structures and creating and modifying objects. If you know how to make your own applets then that is probably sufficient to get started with.
The public properties of the Java Class of which the JavaObject is an instance are presented as properties of the JavaObject object. A JavaObject also inherits the properties from the java.lang.Object Class and any other classes which are in its superclass hierarchy. These are generally available by means of accessor methods so they will likely be listed as methods rather than properties.
The public methods of the Java Class of which the JavaObject is an instance are presented as methods of the JavaObject object. A JavaObject also inherits the methods from the java.lang.Object Class and any other classes which are in its superclass heirarchy.
The only properties and methods this object has, correspond to the public properties and methods of the Java object that it represents. You can enumerate the properties in a loop to inspect the interface to the object from your own scripts; like this:
for(myProp in myJavaObject)
There may be some properties that are not revealed by this and you may need to resort to some Java documentation for further details. Properties and methods for the objects in Java are documented in more depth in Java Programmer's Reference, written by Grant Palmer and published by Wrox Press, which covers JDK 1.3 extensively.
To operate on the JavaObject objects, you really need to know something about the Java objects they encapsulate. There are many standard classes and some that may have been custom written for your project.
Beware that the object may report accessors that don't actually have any purpose in the object you have enumerated.
Having examined some applets and other miscellanous Java objects, a summary list of the accessor methods is presented at the head of this topic.
Some fragments of example code are given here and a couple of important methods are described in adjacent topics. Documenting all the interfaces to an Applet or Java object is so dependent on the object that you should refer to the Applet documentation and source and a Java reference manual for details of the internals of Java code.
Some objects also support a strangly named function that is referred to by an enumerable but apparently unnamed property. It is exposed when you enumerate the properties in a for( ... in ... ) loop and output their names with a document.write(). A property appears in the list that seems to have no name. Checking the property names with the typeof operator reports this as a string so it's not an undefined name. OK, so let's measure its length. The suspect property reports a length of 6 in the example I was testing but it is still invisible. Here's where we try hunches and use our debugging instincts. Wrap the property name in the escape() function. That should tell us what weird characters are there. Voila. It reports that the name is now %3CInit%3E. So the name is the word Init wrapped in < and > characters, which explains why we couldn't see it. The web browser thought it was a tag and didn't recognise it so it was hidden.
The second piece of example code shows how the properties were enumerated and how to display the hidden property name.