JavaSoft - 
Sun MicroSystems
JAVA ACCESSIBILITY
Java Accessibility Java Monitor Tool
Version 0.5
08 October 1997

[Home] [What is it?] [Overview of API Features] [API Reference]
[FAQ] [Tutorial] [Tools] [Changes] [JFC Home Page]

The Java Monitor allows you to obtain information about the objects being displayed on the screen by a particular Java Virtual Machine, and includes options to gain additional accessibility features provided by the JFC classes.

Snap shot of Java Monitor in action.

Preparing Run the Java Monitor:

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

  • Modify your CLASSPATH environment variable so that the jaccess.jar (e.g., jaccess-0.5/jaccess.jar or jaccess-0.5\jaccess.jar) file that comes with this prerelease kit is included in the path.
  • Modify your CLASSPATH environment variable so that the JavaMonitor directory (e.g., jaccess-0.5/examples/JavaMonitor or jaccess-0.5\examples\JavaMonitor) is included in the path.
  • Modify your $JDKHOME/lib/awt.properties file (e.g., jdk1.1.2/lib/awt.properties or C:\jdk1.1.2\lib\awt.properties) to include the following lines (a sample awt.properties can be found here):
  • AWT.EventQueueClass=com.sun.java.accessibility.EventQueueMonitor
    AWT.AutoLoadClasses=JavaMonitor

    After you follow these instructions, you should be ready to run the Java Monitor. If you did not set up your CLASSPATH correctly you might get one of the following errors when running a Java application:

    Failed loading com.sun.java.accessibility.EventQueueMonitor: java.lang.ClassNotFoundException: com.sun.java.accessibility.EventQueueMonitor
    Error trying to newInstance JavaMonitor java.lang.ClassNotFoundException: JavaMonitor

    The first error means that the jaccess.jar file is not in your CLASSPATH, and the second that the JavaMonitor directory is not in your CLASSPATH.

    Running the Java Monitor:

    By following the instructions above, the Java Monitor will automatically be started any time you start a Java application in a virtual machine. For example, if you run the "SwingSet" demonstration application that comes with the prerelease of the JFC (swing-0.5), the Java Monitor will automatically start.

    Using the Java Monitor:

    The Java Monitor provides several rows of checkboxes at the top of its dialog box. These checkboxes allow you to specify the classes of user interface events that you can monitor in the Java Virtual Machine. Java Monitor registers an interest in the events by using calls to the SwingEventMonitor class from the Java Accessibility package whenever you click one of the checkboxes.

    In the middle of the dialog box is a list of events that is updated as each event occurs. Items will be posted in this list only if you select the events you are interested in by manipulating the checkboxes at the top of the box.

    In the bottom left of the dialog box is a small list box that represents the last object to have focus. It is updated each time the focus changes and contains a small sample of the information obtained from interface Accessible. NOTE: This box will not be updated unless you select for Focus events.

    In the lower right of the dialog box is a small List box that you can populate by moving the pointer over an object and pressing the F1 key. This action uses calls to EventQueueMonitor to obtain the current mouse position and obtain an accessible object from that location. It then calls a small number of methods from interface Accessible to display information about the object under the pointer. NOTE: This box will not be updated unless you select for key events.

    NOTE: The JFC Menus will not show any interesting information unless you select for JMenu events.

    NOTE: This is a preliminary release of Java Accessibility. We reserve the right to modify the specification in future versions.


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

    Sun 
MicroSystems