home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Accessibility Many users who are visually impaired use screen readers to read HTML pages to them. Other people who have limited vision need to display text in large fonts in order to read the information comfortably. In the past, Sun has been criticized because Java applets displayed only a graphical image, inaccessible to visually impaired users. Sun has addressed these concerns by adding specific provisions for accessibility into the JDK. You’ll use the new package java.awt.accessibility to ensure that your programs will work well with screen readers, screen magnifiers, and speech recognition systems—a group of hardware and software products collectively known as assistive technology.

ON THE WEB
http://java.sun.com/products/jfc/accessibility/doc/index.html Make sure your Java programs are accessible; this Web page contains information about the utilities Sun developed to enable Java to work with assistive technology.

Drag and Drop Sun has committed itself to supporting “drag and drop” data transfer between Java and native applications, as well as between Java applications and within a single Java application. JDK 1.2 is a first step in that direction. Currently, drag and drop between a Java application and a native application requires support from the native operating system. Sun has not added this capability to the Swing package because it is committed to making Swing 100% Pure Java.

Application Services The term “application services” covers a range of capabilities that can be used by any member of the JFC. Sun has included eight new services for use by Java Foundation Classes:

  Keyboard navigation—Enables you to assign keystroke combinations to events that would typically be selected by mouse clicks (such as selecting a menu item or changing an item on a dialog box).
  Multithreaded event queue—Makes it easier for multiple threads to share a single user interface.
  Undo—Enables you to reverse the effects of a previous user choice.
  Bounded range model—Enables you to manage controls that have a bounded range, such as scroll bars and progress meters.
  Custom cursors—Gives you control over the appearance of the cursor and the location of the hotspot.
  Debug graphics utility—Enables you to highlight each Swing component (in bright red) as it is being drawn, so that you can visually ensure that the component is being drawn correctly.
  Repaint batching—Increases the efficiency of screen repainting.
  Target manager—Enables you to dynamically change the effect of various events, such as mouse clicks.

JavaBeans Enhancements

JavaBeans is a specification that describes Java objects suitable for use in a visual development environment. If you drop a “Bean” into a JavaBeans-aware development environment, you can define its behavior by filling in a dialog box or connecting it with lines to other Beans.


NOTE:  You can learn more about JavaBeans in Using Java 1.2, Chapter 19, “Building Components with JavaBeans.” For a complete book on the subject, see Sams Teach Yourself JavaBeans in 21 Days (Sams, 1997).

Interaction with Applet Semantics In prior versions of the JDK, some conflicts occurred between applet and JavaBeans semantics. This problem made it difficult to use some Beans in an applet. These conflicts are fixed in JDK 1.2.

Better Design-Time Support JDK 1.2 Beans are “smarter” than older Beans—they can send more information back and forth to the builder environment, enabling you to give them more sophisticated behavior.

Beans Runtime Containment and Services Protocol JDK 1.2 Beans are better “citizens” than older Beans when the program is running. They can get more information from their context and can participate in an AWT presentation.

Collections

Sun is gradually improving the set of collection classes shipped with the JDK. Version 1.2 includes seven concrete classes, as well as a variety of algorithms and abstract classes.

When discussing collection classes it’s useful to know a bit about data structures. Table 36.1 summarizes the key characteristics of three important kinds of collection.

These collections may be implemented in any of several data structures. A hash table is a highly efficient structure that can look up most items in one step. Large hash tables may require a significant amount of memory.

Table 36.1—Fundamental Collections

Name Ordered? Duplicate Values Allowed?

Set no no
List yes yes
Map no yes

An array is an efficient structure, although it may be difficult to add or delete entries if you’re also trying to preserve order.

A tree structure maintains order naturally. One of the most common kinds of tree—a balanced binary tree—is particularly efficient when you need fast lookup.

The seven concrete classes are

  HashSet—A set backed by a hash table
  ArrayList—A list implemented in a resizeable array
  LinkedList—A useful starting point if you want to build a deque or queue class
  Vector—A variant of the ArrayList
  HashMap—A map implemented in a hash table
  TreeMap—A map implemented by a balanced binary tree
  Hashtable—A variant of HashMap


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.