- Each class gets its own .js file. The name of the file (less the extension) is the name of the class.
- Use a call to static method jsx3.lang.Class.defineClass to define a class. The first parameter is the name of the class as a string. It can include package-like qualification, but the qualification doesn't actually have to correspond to the location of the .js file. All that matters is that the unqualified name of the class matches the name of the .js file. The second parameter is a reference to the super class and the third parameter is an array of references to implemented interfaces; use the null keyword if either one of these parameters is irrelevant. The forth parameter is a function that declares the class.
- The function that declares the class must receive two arguments. The first is an object to be used as a prefix when declaring static members in the body of the function; the second is for instance members.
- Within the body of instance methods, use the this keyword to reference the instance. Use the unqualified name of the class to reference static members.
- A method named init is required; this acts as the constructor, i.e. it is called for each instance at the time it is created. If there is a superclass (other than the default, jsx3.lang.Object), it's constructor must be called from within init. This can be accomplished by calling the standard jsxsuper() method of the instance, passing any arguments needed by the constructor.
- Declare an instance of the class by using the new keyword followed by the fully-qualified name of the class, followed by arguments to the constructor wrapped in parentheses. For example:
var ratingControl = new gui.ImageButtonGroup();


