Visual Java Runtime Classes
Visual Java applets run in any Java enabled browser or
viewer that supports JDK version 1.0.2 or later.
Applets and applications developed with Visual Java require Visual Java runtime classes in order to run outside of the
Java WorkShop environment. The runtime classes consist of:
- Shadow (wrapper) classes for the standard AWT components.
These include workarounds that help AWT-based programs run
better.
- Architectural base classes, required for writing custom
groups and shadows
- Type converters that convert any type to a string and
vice versa
- Custom components such as the Tabbed Folder Panel, Image Label, and Multiple Column List components
Visual Java is architected to use runtime classes instead of
duplicating the necessary runtime code in the application for
a number of reasons:
- Groups provide public interfaces and base classes that
allow Visual Java GUIs to be included in other Visual Java
GUIs. Any application generated using Visual Java can
be included within another Visual Java application.
- A number of workarounds for AWT problems have been
included in the shadow classes and in AWT sub-classes
included in the runtime classes. These workarounds make it
possible to build complex applications that work on both
Windows and Solaris systems.
- Shadow classes permit delayed instantiation of
components at runtime. Components are not instantiated
until they are displayed the first time--this results in
better startup performance. There is minimal overhead
associated with using shadow classes.
- Generated code is smaller and simpler. Browsers that
can cache classes will experience better performance when
loading a second applet if the second applet uses the same
runtime classes--only the small generated class specific to
the second applet is loaded.
- Shadow classes allow names and attributes for AWT
components to be recorded. This feature allows you to
change the location of the component without having to
change the operation information about the component.
How to Use the Runtime Classes
The runtime classes are located in the following
directory:
<install_dir_path>/JWS/classes/sunsoft/jws/visual/rt
You can redistribute the Visual Java runtime classes with
your applications. They can be copied into the directory
containing your application's main class file, in which
case they will be downloaded by the applet class loader of
the browser or viewer, or they can be installed locally on
the client side and specified in the CLASSPATH variable.
To copy the runtime classes into an application directory,
copy the contents of:
<install_dir_path>/JWS/classes/sunsoft
into the directory that contains the main applet class. On
a Unix system, you can make a link to the sunsoft classes
directory rather than an actual copy.
The first time an applet that requires the runtime classes
to be downloaded is run, there is a delay while the runtime
classes are loaded over the internet. Once the classes are
cached, there is relatively little delay when subsequent
applets are run, unless the applets use runtime classes not
already used by the applets preceding it.
Performance is significantly better if the runtime classes
are installed locally and accessed via the CLASSPATH. The
time it takes to download the runtime classes is affected
more by the number of classes than the size. Most browsers
create a new connection to download each class, which is
very slow.
Easier and faster mechanisms are being investigated. You will
see improvements in this process in future versions.
Netscape Navigator
If an applet is run in Netscape Navigator and the Visual
Java runtime classes are installed locally, Navigator must
be started after the CLASSPATH has been set.
If Navigator fails to find the Visual Java runtime classes,
you will probably see one of the following error messages:
Applet can't start: class Foo got a security
violation: method verification error.
Applet can't start: error.java.lang.NoClassDefFoundError
You may run into situations where it is necessary to
restart Navigator if it has previously failed to find the
runtime classes.
Runtime Class Documentation
To view Visual Java runtime API files generated using javadoc click here.
See also:
- Visual Java Overview
- The Visual Menu
- Visual Java Components
- Laying Out GUI Interfaces
- Generating Java Source Code
- Adding Operations (Filters and
Actions)
- Creating Menus
- Adding Custom Components and Windows
- Using Groups and Shadows (Basic)
- Using Groups and Shadows (Advanced)
- Visual Java API Documentation
- Visual Java
Runtime Packages
- Class
Hierarchy
- Index of
all Fields and Methods