Example usage for javax.swing.text Utilities getNextWord

List of usage examples for javax.swing.text Utilities getNextWord

Introduction

In this page you can find the example usage for javax.swing.text Utilities getNextWord.

Prototype

public static final int getNextWord(JTextComponent c, int offs) throws BadLocationException 

Source Link

Document

Determines the start of the next word for the given location.

Usage

From source file:net.sf.jabref.gui.keyboard.EmacsKeyBindings.java

private static int getWordEnd(JTextComponent jtc, int start) throws BadLocationException {
    try {// w ww. ja  v  a  2 s  .c  o  m
        return Utilities.getNextWord(jtc, start);
    } catch (BadLocationException ble) {
        int end = jtc.getText().length();
        if (start < end) {
            return end;
        } else {
            throw ble;
        }
    }
}