@@ -0,0 +1,688 @@
+package InventoryPK;%0A%0Aimport java.awt.Color;%0A%0Aimport javax.swing.JTextPane;%0Aimport javax.swing.text.AttributeSet;%0Aimport javax.swing.text.SimpleAttributeSet;%0Aimport javax.swing.text.StyleConstants;%0Aimport javax.swing.text.StyleContext;%0A%0Apublic class AppendToTextPane %7B%0A%0A%09public void append(JTextPane tp, Color c, String msg) %7B%0A%09%09%0A%09%09tp.setEditable(true);%0A%09%09%0A%09%09StyleContext sc = StyleContext.getDefaultStyleContext();%0A%09%09AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY,%0A%09%09%09%09StyleConstants.Foreground, c);%0A%09%09int len = tp.getDocument().getLength();%0A%09%09tp.setCaretPosition(len);%0A%09%09tp.setCharacterAttributes(aset, false);%0A%09%09tp.replaceSelection(msg);%0A%09%09%0A%09%09tp.setEditable(false);%0A%09%7D%0A%7D%0A

Create AppendToTextPane.java