Sample IME Applet
This sample is located in \Samples\International\Sampleime.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
This sample shows how to implement a Java-based, level 2 Input Method Editor (IME) using the InputMethodListener and InputMethodCallback interfaces. The sample IME is language-independent and can be used in any localized system where the Microsoft virtual machine (Microsoft VM) is installed.
Using the Sample
You can also run the sample as an application with the following command:
wjview SampleIMETest
To use the sample
The sample IME allows users to input Unicode characters by typing the hexadecimal value of the characters. To use the IME, do the following:
- Disable or turn off your Microsoft® Windows® system IME. For example, if you are using a Japanese version of Windows, select the Direct Input mode. If you are using a Chinese version of Windows, turn off the system IME.
- Click the Click here to activate Sample IME button, then click inside the TextField or TextArea. The IME composition window appears.
- Type in any Unicode value that matches the default font provided on your system, and then press ENTER. For example, if you type 41 and press ENTER, an A appears in the field. In this case, 0x41 (hexadecimal value) is the Unicode representation of the letter A. If you are using a CJK (Chinese, Japanese, and Korean) version of Microsoft® Windows®, you can input CJK characters by typing their Unicode value. For example, if you type 4e00, you should see the Chinese character yi. You can find the table that maps characters to Unicode values in the Unicode Specification 2.0.
- Click the U button in the top left corner of the composition window to close the IME.
Here are some additional tips for using the sample IME:
- This IME accepts only digits 0 through 9 and letters a through f. Characters that are not accepted by the IME appear in the TextField or TextArea.
- You can click inside the composition window and drag it to a new position.
- Use the BACKSPACE key to erase errors, and then retype the characters.
- If no characters appear in the TextField or TextArea, click in one of these fields to make sure that it has the input focus.
- You can press CTRL+ALT to change to different Java-based IMEs. Because this example uses only one Java IME, pressing CTRL+ALT will activate or deactivate the Sample IME. If you are running this IME under CJK versions of Windows, pressing CTRL+ALT the first time switches to the system IME, and pressing it again deactivates both the system IME and the Sample IME. If you press CTRL+ALT a third time, the Sample IME will be activated.
Key Project Files
SampleIME
This class defines the IME.
SampleIMEWindow
This class defines the user interface (composition window) for the IME.
SampleIMETest
This class extends Applet and includes code to run the SampleIME as an applet or a standalone application.
Technologies Demonstrated
Internationalization
- This sample demonstrates how to write a level-2 IME using the InputMethodListener and InputMethodCallback interfaces of the com.ms.util.InputMethod package.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.