VietIME Cross-platform Vietnamese Input Method Editor

Vietnamese version


VietIME, which relies on the input method engine SPI introduced in J2SE v1.3, runs in conjunction with any Java application or applet that employs AWT (TextArea and TextField) and Swing text components. Some examples are JBuilder, NetBeans, Java Studio Creator, Jext, jEdit,...

Note: To work effectively with Vietnamese documents, an application should include provisions for font selection and file opening/saving in Unicode formats.

Installing VietIME

VietIME 1.0 requires Java 2 Runtime Environment 1.3 or later; VietIME 1.0.x requires 1.4 or later. To make the Vietnamese IME available to Java applications and applets, its jar file, VietIME.jar, should be copied into the extensions directory of a J2RE. For J2SE v1.4.2, this would be C:\Program Files\Java\j2re1.4.2\lib\ext directory on Windows, /usr/java/j2re1.4.2/lib/ext on Solaris and Linux, or /Library/Java/Extensions on Mac OS X.

You can also specify the extension directory at start-up time by setting the java.ext.dirs system property. For example, if VietIME.jar is placed in C:\VietIME directory, you can make input methods available to your program by the following command:

java -Djava.ext.dirs=C:\VietIME -jar yourprogram.jar

Note to Developers: Java programs run within an integrated development environment—JBuilder or NetBeans, e.g.—using the JDK configured for that IDE. Therefore, to enable input of Vietnamese text for software design or testing in IDE, VietIME.jar should also be copied into the extensions directory of the JRE under the JDK used for the IDE, e.g., C:\j2sdk1.4.2\jre\lib\ext on Windows.

Selecting Vietnamese Input Method

After launching a Java application with a text component that supports input methods, the input method can be selected using the input method selection user interface provided by the runtime environment. First, make sure that a text component has the focus—typically, the text component indicates this by showing a blinking insertion point. Then, for Sun's Java 2 Runtime Environment, choose the Select Input Method menu item from the menu that can be pulled down from the top left corner of the window (the System menu on Windows, Window menu on Solaris). One can also right-click on the application's title bar to get this menu. If you have installed J2RE 1.4 or higher and the Select Input Method option still isn't there, then the input method hasn't been installed properly.

For platforms that do not have the Select Input Method menu item in the system menu, such as Linux and Mac OS X, Sun provides an alternative way to select an input method by pressing a user-defined hot key. This way of selecting an input method is also useful for platforms that have the menu item in the system menu, e.g., Solaris and Microsoft Windows. If you press your favorite hot key defined by the Input Method Hot Key tool, the same popup menu discussed previously is displayed.

For applets running in Java-enabled web browsers with J2RE plug-in installed, the same hot key mechanism for Linux and Mac OS X is applied, in which the hot key, once configured using the input method hot selection key tool, can be pressed to pop up the input method selection menu when the text component in the applet gets focus.

Choose Vietnamese Input Method from the menu to activate the input method.

Activation of IME is typically indicated by the appearance of a small status window that shows the currently selected input method. Initially this window is positioned near the lower right corner of the screen, but it can be moved to a different location. To disable the current Vietnamese input method, bring up the popup menu and select System Input Methods; the status window will be hidden subsequently.

The context menu associated with the status window provides full control of the input engine, allowing users to select the desired input method option. VietIME supports three common Vietnamese input methods—VNI, VIQR, and Telex. Selection of the SmartMark option allows entering diacritical marks at word ends, besides the traditional method.

Users can now start inputting Vietnamese text in the text component that currently has the focus. The underlying operating system should already have Vietnamese Unicode fonts installed, and the Java application should have the ability to select and display them.

Note: Turn off other Vietnamese keyboard drivers while you use VietIME to avoid interference in interpreting key entries.

Version 1.2 integrates new functionalities that are frequently used in editing Vietnamese text, such as Spell Check, Convert, Change Case, Strip Diacritics, Normalize Diacritics, Sort Vietnamese words, etc. These operations, however, are available only to Java Swing applications.

Since version 1.0.4, VietIME has been localized in support of Vietnamese locale vi in J2SE 1.5.0. If the host application is launched with system or application locale set to Vietnamese, the status window and its context menu will be presented in Vietnamese.

Current Limitations

If the caret is moved away from a character or a word waiting for marking (which one, a character or a word, depends on whether a SmartMark option is selected), that character or word loses the ability to accept accent marks. It will need to be re-typed before a diacritical mark can be combined with it.

Note: There's a bug in J2SE v1.3 that prevents proper display of some Vietnamese characters in Java text components on Windows 9x/Me. The bug is fixed in J2SE v1.4.

Note to Linux Users: To make Unicode fonts available to Java applications, you may need to set the environment variable JAVA_FONTS to the appropriate font paths and then export it. This is usually done in /etc/profile file. More information can be found in Install and configure Unicode TrueType fonts in Linux and Configure Java environment on Linux.

Tips: You may opt to modify file under j2re1.4.2/lib subdirectory to enable display of Vietnamese on Java Swing components in Windows or Linux without programmatically setting font for each component.