摘要: 1 import java.awt.Color; 2 import java.util.Set; 3 4 import javax.swing.JTextPane; 5 import javax.swing.SwingUtilities; 6 import javax.swing.event.DocumentEvent; 7 import javax.swing.event.DocumentListener; 8 import javax.swing.text.AttributeSet; 9 import javax.swing.text.BadLocationExcep... 阅读全文
posted @ 2013-08-17 19:54 skyko 阅读(1142) 评论(0) 推荐(0) 编辑
摘要: 1 SimpleAttributeSet attributeSet = new SimpleAttributeSet();2 StyleConstants.setForeground(attributeSet, color);3 boolean replace = false;4 if (startPointer != endPointer) {5 StyledDocument doc = jTextPane.getStyledDocument();6 doc.setCharacte... 阅读全文
posted @ 2013-08-17 19:38 skyko 阅读(668) 评论(0) 推荐(0) 编辑