Skip to main content

3.0 Java Foundation Classes (JFC) - A Foundation for Accessibility

3.0 Java Foundation Classes (JFC) - A Foundation for Accessibility

In February of 1997, Sun Microsystems and IBM began a collaboration to solve the problem of access-enabling software as applications are being developed. Their goal was to develop an accessibility API that application developers could implement on Java class libraries to make them accessible. Sun wrote the Accessibility API and implemented it on their Java Foundation Classes. The IBM Human Ability and Accessibility Center helped define and implement the API, and tested the JFC implementation with the Access Engine technology in IBM's Self Voicing Kit.

[block diagram of JFC structure]

FIGURE 1.0 JFC Architecture

JFC includes the Swing components. Swing is an enhancement of - not a replacement for - the Abstract Windowing Toolkit (AWT). Sun Microsystems has now integrated JFC/Swing directly into JDK 1.2 and above. An important difference between Swing and AWT is that Swing creates its components using "Pluggable Look & Feel" (PLAF) modules that do not use native code.

As shown in Figure 1.0 above, Swing sits atop of part, but not all, of the AWT components. Swing sits on a number of the APIs that implement the various parts of AWT, including Java2D, Drag-and-Drop, and the Accessibility API.

A key feature of the PLAF is that it enables developers to swap the Look and Feel of the user interface. This feature allows a developer to create a Look and Feel which can be "directly accessible" to a specific disability. For example you could create an audio, Braille, or other alternative user interface to your application. The Sun accessibility group also added a mechanism to the JFC called the Multiplexed UI, which is an extension to the PLAF. The Multiplexed UI allows developers and assistive technologies to add multiple alternative user interfaces to the JFC component library when a Java Virtual Machine (JVM) starts. The Multiplexed UI also makes multi-modal access features possible, such as hands-free voice access to applications that both disabled and non-disabled people alike use, possible with very little development effort.

3.1 Why Use the JFC?

The "already-implemented" Accessibility API and the Multiplexed UI features of the JFC are why these guidelines encourage you to use the JFC to build your applications. Figure 1.1 highlights the JFC accessible component architecture and Figure 1.2 shows how an assistive technology views the "Big Picture".


Figure 1.1 JFC's Accessible Component Architecture

JFC's Accessible Component Architecture

The JFC lets you:

If you choose to create your own custom class library, implement the Java Accessibility API on your class library components. To build an accessible application with the least amount of effort do the following:

  1. Wherever possible, use JFC components to build your application, as described in section 4.0 Using the JFC to Build Accessible Applications.
  2. If the rich class library in the JFC does not have a component that meets your needs, create your hybrid component by subclassing the JFC JComponent class. Implement the Accessibility API on your component, as described in section 5.0 Building Custom Accessible Components. The JFC comes with source and there are many examples on which to base your implementation.
  3. If steps 1 and 2 do not meet your needs, implement the Accessibility API on your class library or component as described in section 6.0 The Accessibility API
  4. Follow the check list in section 8.0 Testing for Accessibility.

Figure 1.2 Big Picture View

Big Picture View by Assistive Technology of Accessible Application

3.2 Setting up the JFC Development Environment

The first step toward writing accessible Java applications is to download and install the following software development kits:

JFC development environment
JFC Component Type of Example
Java 2 Standard Edition http://java.sun.com/j2se
IBM Self Voicing Kit for Java (optional) IBM alphaWorks site (Text Only Version)

FIGURE 2.0 JFC development environment

On the Sun site, there is a reference to the different versions of the software development kits. It is recommended that you download the latest Java 2 SDK 1.3.X which includes the latest JFC/Swing improvements. Follow the installation instruction included with the Java 2 SDK for proper setup of the JVM on your machine. Note: IBM has announced a new family of Java 2 Standard Edition 1.3 implementations for nine operating system platforms. Follow the IBM Java developer site for future information.

The Self Voicing Kit for Java is an optional assistive technology that speaks your Java application and includes an accessibility test tool that can help you in developing your Java application.

Next: 4.0 Using the JFC to Build Accessible Applications