List of usage examples for javax.swing.text Segment toString
public String toString()
From source file:Console.java
void returnPressed() { Document doc = getDocument(); int len = doc.getLength(); Segment segment = new Segment(); try {//from ww w . ja v a 2 s. c om synchronized (doc) { doc.getText(outputMark, len - outputMark, segment); } } catch (javax.swing.text.BadLocationException ignored) { ignored.printStackTrace(); } if (segment.count > 0) { history.addElement(segment.toString()); } historyIndex = history.size(); inPipe.write(segment.array, segment.offset, segment.count); append("\n"); synchronized (doc) { outputMark = doc.getLength(); } inPipe.write("\n"); inPipe.flush(); console1.flush(); }