Code example for AttributedString

Methods: getIterator

0
 
    void sendInputMethodEvent() { 
        InputMethodEvent ime = new InputMethodEvent(
                ep,
                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, 
                Hiragana_A.getIterator(),
                0, 
                null, 
                null); 
        ep.dispatchEvent(ime);
    } 
 
    void checkComposedTextRun() { 
        HTMLDocument d = (HTMLDocument) ep.getDocument();
        ElementIterator it = new ElementIterator(d.getDefaultRootElement());
 
        while (true) { 
            Element e = it.next();
            if (e == null) { 
                throw new RuntimeException("no composed text found");
            }