
org.yaoqiang.collaboration.ChatArea Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yaoqiang-bpmn-editor Show documentation
Show all versions of yaoqiang-bpmn-editor Show documentation
an Open Source BPMN 2.0 Modeler
package org.yaoqiang.collaboration;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
/**
* ChatArea
*
* @author Shi Yaoqiang([email protected])
*/
public class ChatArea extends JTextPane {
private static final long serialVersionUID = -7761671557049096578L;
public SimpleAttributeSet styles = new SimpleAttributeSet();
public void insertText(String text) {
final Document doc = getDocument();
try {
doc.insertString(doc.getLength(), text, styles);
} catch (BadLocationException e) {
e.printStackTrace();
}
setCaretPosition(doc.getLength());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy