String text = c.getText();
  public static final int getWordStart(JTextComponent c, int offs)      throws BadLocationException  {    if (offs < 0 || offs >= c.getText().length())      throw new BadLocationException("invalid offset specified", offs);        String text = c.getText();    BreakIterator wb = BreakIterator.getWordInstance();    wb.setText(text);    if (wb.isBoundary(offs))      return offs;    return wb.preceding(offs);  }