The Source for Java - java.sun.com
JAVA ACCESSIBILITY
Explorer Example
Version 1.1

[Home] [What are they?] [Overview of API Features] [API Reference]
[FAQ] [Examples] [Changes] [Compatibility table] [JFC Home Page]

Based on user settings (in the Settings menu), Explorer tracks mouse movement, focus updates, and text caret movement in a particular JavaTM Virtual Machine. If set to do so, when it detects that the mouse has stopped moving for a short period of time, it calls EventQueueMonitor's method, getAccessibleAt, to determine the Accessible object under the mouse. Once it has done so, it displays the Accessible information of that object. Similarly, if set to do so, when it detects that a new UI object has the focus, it displays the Accessible information for that new UI object. Further, if set to do so, it will display the Accessible information for the text object containing the caret when the caret moves. Finally, if set to do so, it will call EventQueueMonitor's method, getAccessibleAt, to determine the Accessible object under the mouse when the user the F1 key, and then display the Accessible information of that object.

Snap shot of Explorer in action.

Preparing to Run Explorer with JDK1.1:

To run Explorer with JDK1.1, you need to have obtained and installed JFC 1.1 with Swing 1.1 and JDK1.1.6.  In addition, you need to be using the Java Accessibility Utilities Version 1.1.

The Explorer class is in the examples/Explorer directory included with this release of the Java Accessibility Utilities (click here to view the source). The compiled classes of Explorer are also included in the jaccess-examples.jar file includes with this release.  Before you can run Explorer, you need to set up your environment appropriately by following these instructions:

  • Add the jaccess.jar and jaccess-examples.jar files to your CLASSPATH environment variable.
  • Modify your $JDKHOME/lib/awt.properties file to include the following lines:
  • AWT.EventQueueClass=com.sun.java.accessibility.util.EventQueueMonitor
    AWT.assistive_technologies=Explorer
    After you follow these instructions, you should be ready to run Explorer.  If you did not set up your CLASSPATH correctly you might get one of the following errors when running a JavaTM application:
    Failed loading com.sun.java.accessibility.util.EventQueueMonitor: 
    java.lang.ClassNotFoundException: 
    com.sun.java.accessibility.util.EventQueueMonitor
    Error trying to newInstance Explorer java.lang.ClassNotFoundException: 
    Explorer
    The first error means the jaccess.jar file is not in your CLASSPATH, and the second means the jaccess-examples.jar file is not in your CLASSPATH.

    Running Explorer with JDK1.2:

    To run Explorer with JDK1.2 you need to have obtained and installed JDK1.2.  In addition, you need to be using the Java Accessibility Utilities Version 1.2.

    The Explorer class is in the examples/Explorer directory included with this release of the Java Accessibility Utilities (click here to view the source). Before you can run it, you need to set up your environment appropriately by following these instructions:

  • Copy jaccess.jar and jaccess-examples.jar to the $JDKHOME/jre/lib/ext directory under your JDK1.2 installation.
  • Modify (create one if it doesn't exist) your $JDKHOME/jre/lib/accessibility.properties file to include the following line:
  • assistive_technologies=Explorer
    After you follow these instructions, you should be ready to run Explorer.

    Running Explorer with JDK1.1 or JDK1.2:

    By following the instructions above, Explorer will automatically be started any time you start a Java application. For example, you can run the SwingSet demo that comes as part of the demonstration applications for Swing.

    Using Explorer:

    Choose the mechanism(s) you want to use Explorer by making selections from the Settings menu. Until you tell Explorer how to explore, it will remain quiescent. To automatically explore the Java Accessibility API of the object under the mouse as the mouse moves, choose "Track Mouse" from the Settings menu. To automatically explore the Java Accessibility API of the object receiving focus, choose "Track Focus" from the Settings menu. To automatically explore the Java Accessibility API of the text object in which caret movements are occuring, choose "TrackCaret". Finally, to explore the Java Accessibility API of objects under the mouse upon command when you hit the F1 key on your keyboard, choose "Update with F1 key" from the Settings menu.

    Java Logo Copyright© 1995-98 Sun Microsystems, Inc. All Rights Reserved.
    To submit comments or suggestions about Java Accessibility, please send mail to access@sun.com.

    Sun MicroSystems