javax.swing.text.AbstractDocument.createPosition()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中javax.swing.text.AbstractDocument.createPosition()方法的一些代码示例,展示了AbstractDocument.createPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractDocument.createPosition()方法的具体详情如下:
包路径:javax.swing.text.AbstractDocument
类名称:AbstractDocument
方法名:createPosition

AbstractDocument.createPosition介绍

暂无

代码示例

代码示例来源:origin: net.sf.jt400/jt400

/**
Returns a position that will track changes as the document is altered.
If the relative position is null, then the start  of the document will
be used.

@param offset   The offset from the start of the document.
@return         The position.

@exception      BadLocationException    If the given offset does not
                    represent a valid location in the
                    document.
**/
  public synchronized Position createPosition (int offset)
    throws BadLocationException
  {
    return document_.createPosition (offset);
  }

代码示例来源:origin: net.sf.jt400/jt400

/**
Returns a position that will track change as the document is altered.
If the relative position is null, then the start  of the document will
be used.

@param offset   The offset from the start of the document.
@return         The position.

@exception      BadLocationException    If the given offset does not
                    represent a valid location in the
                    document.
**/
  public synchronized Position createPosition (int offset)
    throws BadLocationException
  {
    return document_.createPosition (offset);
  }

代码示例来源:origin: T145/JTerm

void protect(int start, int end) {
  try {
    positions.put(doc.createPosition(start), doc.createPosition(end));
  } catch (BadLocationException ble) {
    JTerm.out.println(TextColor.ERROR, ble.toString());
  }
}

相关文章