* Positions the composition window near (usually below) the
* insertion point in the client component if the client
* component is an active client (below-the-spot input).
*/
void updateWindowLocation() {
InputMethodRequests req = handler.getClientInputMethodRequests();
if (req == null) {
// not an active client
return;
}
Point windowLocation = new Point();
Rectangle caretRect = req.getTextLocation(null);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension windowSize = compositionWindow.getSize();
final int SPACING = 2;
if (caretRect.x + windowSize.width > screenSize.width) {