144 * with input methods. As a consequence, some key events do not reach the text 145 * component because they are handled by an input method, and some text input 146 * reaches the text component as committed text within an {@link 147 * java.awt.event.InputMethodEvent} instead of as a key event. 148 * The complete text input is the combination of the characters in 149 * <code>keyTyped</code> key events and committed text in input method events. 150 * <p> 151 * The AWT listener model lets applications attach event listeners to 152 * components in order to bind events to actions. Swing encourages the 153 * use of keymaps instead of listeners, but maintains compatibility 154 * with listeners by giving the listeners a chance to steal an event 155 * by consuming it. 156 * <p> 157 * Keyboard event and input method events are handled in the following stages, 158 * with each stage capable of consuming the event: 159 * 160 * <table class="striped"> 161 * <caption>Stages of keyboard and input method event handling</caption> 162 * <thead> 163 * <tr> 164 * <th id="stage">Stage</th> 165 * <th id="ke">KeyEvent</th> 166 * <th id="ime">InputMethodEvent</th></tr> 167 * </thead> 168 * <tbody> 169 * <tr><td headers="stage">1. </td> 170 * <td headers="ke">input methods </td> 171 * <td headers="ime">(generated here)</td></tr> 172 * <tr><td headers="stage">2. </td> 173 * <td headers="ke">focus manager </td> 174 * <td headers="ime"></td> 175 * </tr> 176 * <tr> 177 * <td headers="stage">3. </td> 178 * <td headers="ke">registered key listeners</td> 179 * <td headers="ime">registered input method listeners</tr> 180 * <tr> 181 * <td headers="stage">4. </td> 182 * <td headers="ke"></td> 183 * <td headers="ime">input method handling in JTextComponent</tr> 184 * <tr> 185 * <td headers="stage">5. </td><td headers="ke ime" colspan=2>keymap handling using the current keymap</td></tr> 186 * <tr><td headers="stage">6. </td><td headers="ke">keyboard handling in JComponent (e.g. accelerators, component navigation, etc.)</td> 187 * <td headers="ime"></td></tr> 188 * </tbody> 189 * </table> 190 * 191 * <p> 192 * To maintain compatibility with applications that listen to key 193 * events but are not aware of input method events, the input 194 * method handling in stage 4 provides a compatibility mode for 195 * components that do not process input method events. For these 196 * components, the committed text is converted to keyTyped key events 197 * and processed in the key event pipeline starting at stage 3 198 * instead of in the input method event pipeline. 199 * <p> 200 * By default the component will create a keymap (named <b>DEFAULT_KEYMAP</b>) 201 * that is shared by all JTextComponent instances as the default keymap. 202 * Typically a look-and-feel implementation will install a different keymap 203 * that resolves to the default keymap for those bindings not found in the 204 * different keymap. The minimal bindings include: 205 * <ul> 206 * <li>inserting content into the editor for the 207 * printable keys. | 144 * with input methods. As a consequence, some key events do not reach the text 145 * component because they are handled by an input method, and some text input 146 * reaches the text component as committed text within an {@link 147 * java.awt.event.InputMethodEvent} instead of as a key event. 148 * The complete text input is the combination of the characters in 149 * <code>keyTyped</code> key events and committed text in input method events. 150 * <p> 151 * The AWT listener model lets applications attach event listeners to 152 * components in order to bind events to actions. Swing encourages the 153 * use of keymaps instead of listeners, but maintains compatibility 154 * with listeners by giving the listeners a chance to steal an event 155 * by consuming it. 156 * <p> 157 * Keyboard event and input method events are handled in the following stages, 158 * with each stage capable of consuming the event: 159 * 160 * <table class="striped"> 161 * <caption>Stages of keyboard and input method event handling</caption> 162 * <thead> 163 * <tr> 164 * <th scope="col" id="stage">Stage 165 * <th scope="col" id="ke">KeyEvent 166 * <th scope="col" id="ime">InputMethodEvent 167 * </thead> 168 * <tbody> 169 * <tr> 170 * <th scope="row" headers="stage">1. 171 * <td headers="ke">input methods 172 * <td headers="ime">(generated here) 173 * <tr> 174 * <th scope="row" headers="stage">2. 175 * <td headers="ke">focus manager 176 * <td headers="ime"> 177 * </tr> 178 * <tr> 179 * <th scope="row" headers="stage">3. 180 * <td headers="ke">registered key listeners 181 * <td headers="ime">registered input method listeners 182 * <tr> 183 * <th scope="row" headers="stage">4. 184 * <td headers="ke"> 185 * <td headers="ime">input method handling in JTextComponent 186 * <tr> 187 * <th scope="row" headers="stage">5. 188 * <td headers="ke ime" colspan=2>keymap handling using the current keymap 189 * <tr> 190 * <th scope="row" headers="stage">6. 191 * <td headers="ke">keyboard handling in JComponent (e.g. accelerators, 192 * component navigation, etc.) 193 * <td headers="ime"> 194 * </tbody> 195 * </table> 196 * 197 * <p> 198 * To maintain compatibility with applications that listen to key 199 * events but are not aware of input method events, the input 200 * method handling in stage 4 provides a compatibility mode for 201 * components that do not process input method events. For these 202 * components, the committed text is converted to keyTyped key events 203 * and processed in the key event pipeline starting at stage 3 204 * instead of in the input method event pipeline. 205 * <p> 206 * By default the component will create a keymap (named <b>DEFAULT_KEYMAP</b>) 207 * that is shared by all JTextComponent instances as the default keymap. 208 * Typically a look-and-feel implementation will install a different keymap 209 * that resolves to the default keymap for those bindings not found in the 210 * different keymap. The minimal bindings include: 211 * <ul> 212 * <li>inserting content into the editor for the 213 * printable keys. |