The Source for Java - java.sun.com
JAVA ACCESSIBILITY
Ferret Example
Version 1.3

[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), Ferret 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 Ferret in action.

Preparing to Run Ferret with JDK1.1:

To run Ferret 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 Ferret class is in the examples/Ferret directory included with this release of the Java Accessibility Utilities (click here to view the source). The compiled classes of Ferret are also included in the jaccess-examples.jar file includes with this release.  Before you can run Ferret, 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=Ferret
    After you follow these instructions, you should be ready to run Ferret.  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 Ferret java.lang.ClassNotFoundException: 
    
    Ferret
    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 Ferret with JDK1.2 and later:

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

    The Ferret class is in the examples/Ferret 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 or later installation.
  • Modify (create one if it doesn't exist) your $JDKHOME/jre/lib/accessibility.properties file to include the following line:
  • assistive_technologies=Ferret
    After you follow these instructions, you should be ready to run Ferret.

    Running Ferret with JDK1.1, JDK1.2 or later:

    By following the instructions above, Ferret 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 Ferret:

    Choose the mechanism(s) you want to use Ferret by making selections from the Settings menu. Until you tell Ferret 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 LogoCopyright© 1995-99 Sun Microsystems, Inc. All Rights Reserved.
    To submit comments or suggestions about Java Accessibility, please send mail to access@sun.com.

    Sun MicroSystems