J2SE 1.3.0 has a new Robot API that is designed to make automated Abstract Window Toolkit (AWT) and Swing testing possible. The Robot API enables code that is written in the Java programming language to generate low-level native mouse and keyboard input events. Because the events are generated at the operating system level, they are indistinguishable from real user input to the rest of the AWT.
Though designed primarily to improve testability, the Robot API also provides other benefits:
Accessibility-enabled applications can give more feedback. For example, if the user acts on a screen object by using voice commands, the mouse pointer can be moved to indicate the object being manipulated.
The Robot API enables creation of computer-based training (CBT) and other demo-type applications.
J2SE 1.3.0 also has an improved API for printing. The new printing API gives developers an easy mechanism to print the AWT components by using native platform facilities. By using the new API, developers can control properties of a print job such as destination, number of copies, page ranges, page size, orientation, print quality, and more.
J2SE 1.3.0 introduces support for rendering on multiple monitors the GUI Frames and Windows that belong to the same application. The Java 2DTM API supports three multi-screen configurations:
Two or more independent screens
Two or more screens where one screen is the primary screen and the other screens display copies of what appears on the primary screen
Two or more screens that form a virtual desktop
With J2SE 1.3.0's new dynamic font-loading API, a developer can create and load TrueType fonts during runtime. Developers can use the Java 2D API to give their dynamically loaded fonts the desired features such as size, style, transforms, and others.
The Java 2D API in J2SE 1.3.0 now supports the Portable Graphics Network (PGN) format, a flexible, extensive, non-proprietary file format that represents lossless and portable storage of raster images. PGN supports gray scale, indexed-color, and truecolor images, with an optional alpha channel.
JPDA technology is a multi-tiered debugging architecture that enables tool developers to easily create debugger applications that run portably across platforms, virtual-machine implementations, and J2SE versions.
JPDA consists of three layers:
JVMDI - Java Virtual Machine Debug Interface
Defines the debugging services a VM must provide for debugging.
JDWP - Java Debug Wire Protocol
Defines the format of information and requests transferred between the process being debugged and the debugger front end, which implements the Java Debug Interface.
JDI - Java Debug Interface
Defines a high-level Java programming language interface that tool developers can easily use to write remote debugger applications.
The internationalization enhancements in the J2SE 1.3.0 release give developers even more flexibility in localizing their applications for international users. Two new features are described here.
Input methods are software components that interpret user operations such as typing keys or speaking to generate text input for applications, and they play an important role in enabling entry of text in international locales. Unlike English text which can be entered by directly typing it in from the keyboard, entering text in languages such as Japanese or Chinese requires a more sophisticated input method framework, and J2SE 1.3.0 provides a powerful set of the tools that developers need to handle the job.
Modern text-editing components permit the display of entered text inside the context of the document in which the text will finally appear. This is called the on-the-spot input, and it has always been supported by the Java 2 Platform.
J2SE 1.3.0 adds support for a second style of input, called below-the-spot, that is popular is such countries such as China. In below-the-spot text editing, composed text is shown in a separate composition window that is automatically positioned close to the insertion point where text will be inserted.
It might be that a developer would want to change and customize the windows that appear as part of his or her input method framework. J2SE 1.3.0 gives developers full flexibility to do so by providing a new API for an input method engine Service Provider Interface (SPI). The SPI enables developers to construct their own custom input method engines to meet the needs their software.
A further example of new international locale support is that J2SE 1.3.0 can render application frames and dialog boxes to have toolbars and menu bars with a right-to-left orientation for locales such as Arabic and Hebrew.
J2SE 1.3.0 contains select new functionality that Sun has added to the platform and Java 2 SDK tools suite in consultation with business partners and in response to input from developers. A sampling of the enhancements include:
New javac Compiler
The javac compiler has been re-implemented from scratch in J2SE 1.3 making it faster for many applications than the compilers in previous versions of the Java 2 SDK.
Dynamic Proxy Classes
J2SE 1.3 contains a new API for dynamic proxy classes. A dynamic proxy class is a class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class is encoded and dispatched to another object through a uniform interface. Thus, you can use a dynamic proxy class can be used to create a type-safe proxy object for a list of interfaces without requiring pre-generation of the proxy class, such as with compile-time tools. Dynamic proxy classes are useful to developers who need to provide the type-safe reflective dispatch of invocations to objects that present interface APIs.
For example, you can use a dynamic proxy class to create an object that implements multiple arbitrary event listener interfaces to process a variety of events of different types in a uniform fashion, such as by logging all such events to a file.
Expanded API for Collections
The J2SE 1.3 version of the popular Collections API has been made even easier for you to use. The 1.3 Collections API includes new convenience methods and copy constructors for Lists and Maps.
Expanded Java Foundation Classes/Swing Functionality
A large part of the J2SE 1.3.0 engineering effort has been directed into tuning and enhancing the Swing components of the Java Foundation Classes API. In addition to performance tuning of the Swing libraries, new JFC/Swing functionality has been added to the Swing libraries in several areas. One example is the new support for variable-height rows in lightweight table components.
Improved Math and Utility Libraries
J2SE 1.3.0 includes two math-related classes that have the same API: Math and StrictMath. StrictMath is defined to return bit-for-bit reproducible results for numeric operations in all implementations for developers who need that guarantee. Implementations of class Math, on the other hand, can vary within specified constraints to enable flexibility for better performance. Developers who want best performance but don't require bit-for-bit reproducible results on different platforms will want to use Math rather than StrictMath for their numeric code.
The J2SE API for arbitrary precision math, classes BigInteger and BigDecimal, enables arithmetic operations that never overflow or lose precision, features necessary for many types of computations such as financial calculations. Class BigInteger has been reimplemented in pure Java programming-language code. Previously, the implementation of the BigInteger class was based on an underlying C library. The new implementation performs many standard operations faster than the old implementation. The new API also includes new convenience features that make it easier for you to use.
A new Timer API has been added to the Java 2 Platform to support animations, human interaction timeouts, on-screen clocks and calendars, work-scheduling routines, reminder facilities, and more.
An API for virtual machine shutdown hooks has been added to class java.lang.Runtime that provides a simple, portable interface to the underlying operating system's process-shutdown notification so that an application written in the Java programming language can initiate shutdown actions such as closing down network connections, saving session state, and deleting temporary files.
New delete-on-close mode for opening Zip and Jar files has been added so that long-running server applications can delete no-longer-needed JarFile objects and data to keep disk space free.