java

Summary

Any class in the Java package java.*.

Property of Packages
Implemented in: JavaScript 1.1, NES2.0

Syntax

Packages.java

Description

Use the java property to access any class in the java package from within JavaScript. Note that the top-level object java is a synonym for Packages.java.

Examples

Example: Using Packages.java

The following code accesses the constructor of the java.awt.Frame class:

var theOwner = new Packages.java.awt.Frame();

You can simplify this code by using the top-level java object to access the constructor as follows:

var theOwner = new java.awt.Frame();

Document Tags and Contributors

 Contributors to this page: fscholz, Maian, Marcoos, Dria
 Last updated by: fscholz,