日曜日, 1月 13, 2008

InputContext and IME

I had such an unpleasant time looking through pages about IME -- as if everybody is using languages that use alphabets only. But for the most of us who use not only alphabets but also other scripts, here are some pieces of advice. Just a few lines -- but you can control IME from Java applications.

InputContext inputContext=null;
inputContext=frame.getInputContext();
inputContext.selectInputMethod(Locale.JAPAN);

This turns on Japanese IME. If you alter the locale to Locale.TAIWAN, or instantiate the class with language and country codes as:
Locale locale=new Locale("hi","IN");

then you can turn on the IME of your choice from your Java application.

PHP: 定数を扱う

プロジェクトごとの定数を扱うクラス Config\Constants の紹介です。 <?php namespace Config; class Constants {     public const DB_USER = "linguist...