docs: public int getPosition(int line) {
          int result = -1;
          try {
              result = textArea.getLineStartOffset(line);
          } catch (javax.swing.text.BadLocationException exc) {
          }
          return result;
      }