本文整理了Java中javax.swing.text.Segment.last()
方法的一些代码示例,展示了Segment.last()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Segment.last()
方法的具体详情如下:
包路径:javax.swing.text.Segment
类名称:Segment
方法名:last
暂无
代码示例来源:origin: bobbylight/RSyntaxTextArea
char ch = seg.last();
代码示例来源:origin: stackoverflow.com
Segment seg = new Segment(); // can be reused
Document doc = textArea.getDocument();
doc.getText(doc.getLength() - 1, 1, seg);
char last = seg.last(); // equal to seg.first()
代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea
char ch = seg.last();
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
char previous = text.last();
for (text.last(); previous != Segment.DONE; previous = text.previous()) {
代码示例来源:origin: de.sciss/jsyntaxpane
/**
* Gets the line at given position. The line returned will NOT include
* the line terminator '\n'
* @param pos Position (usually from text.getCaretPosition()
* @return the STring of text at given position
* @throws BadLocationException
*/
public String getLineAt(int pos) throws BadLocationException {
Element e = getParagraphElement(pos);
Segment seg = new Segment();
getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset(), seg);
char last = seg.last();
if (last == '\n' || last == '\r') {
seg.count--;
}
return seg.toString();
}
代码示例来源:origin: de.sciss/syntaxpane
/**
* Gets the line at given position. The line returned will NOT include
* the line terminator '\n'
* @param pos Position (usually from text.getCaretPosition()
* @return the String of text at given position
*/
public String getLineAt(int pos) throws BadLocationException {
Element e = getParagraphElement(pos);
Segment seg = new Segment();
getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset(), seg);
char last = seg.last();
if (last == '\n' || last == '\r') {
seg.count--;
}
return seg.toString();
}
代码示例来源:origin: com.fifesoft/rsyntaxtextarea
char ch = seg.last();
内容来源于网络,如有侵权,请联系作者删除!