
CHAPTER 17
Thejava.awt.im Package
The java.awt.im package contains classes and interfaces used by input methods and
by the text-editing user interface components that interact with input methods.
Most applications rely on GUI components that have input method support built
in and do not need to use this package directly. In other words, input method
details are usually hidden by text input components, and application-level code
should never have to use these classes and interfaces. Figure 17-1 shows the class
hierarchy of this package, which is new in Java 1.2.
extends
KEY
CLASS
FINAL CLASS
INTERFACE
InputMethodHighlight
java.awt.im
java.lang
Object
InputContext
Character.Subset
InputMethodRequests
InputSubset
Figur e 17−1: The java.awt.im package
InputContext Ja va 1.2
java.awt.im
This class serves as an intermediary between input methods and the text input compo-
nents that use them. An InputContext stor es the state related to one pending text compo-
sition operation. By default, there is one InputContext per Window. Components can
obtain this shared input context with the Component.getInputContext() method. Compo-
nents that need a private InputContext can create their own with InputContext.getInstance().
java.awt.im
329
14 September 1999 10:02