context = Context.enter();
// init std object with an importer
ImporterTopLevel importer = new ImporterTopLevel();
scope = context.initStandardObjects(importer);
// import Java lang package & DOM Level 2 & SVG DOM packages
NativeJavaPackage[] p={new NativeJavaPackage("java.lang"),
new NativeJavaPackage("org.w3c.dom"),
new NativeJavaPackage("org.w3c.dom.css"),
new NativeJavaPackage("org.w3c.dom.events"),
new NativeJavaPackage("org.w3c.dom.smil"),
new NativeJavaPackage("org.w3c.dom.stylesheets"),
new NativeJavaPackage("org.w3c.dom.svg"),
new NativeJavaPackage("org.w3c.dom.views")};
importer.importPackage(context, scope, p, null);
context.setWrapHandler(new EventTargetWrapHandler(this));
Context.exit();
}