importjava.awt.Color;public class PrintColorPanel extendsJPanel {/*** O*/
private static final long serialVersionUID = 786968642266699123L;publicJTextPane textPane;publicJScrollPane scrollPane;/*** Create the panel.*/
public PrintColorPanel(int width,intheight) {
setLayout(null);
setSize(newDimension(width,height));
scrollPane= newJScrollPane();
scrollPane.setBounds(5, 5, width-10, height-10);
textPane= newJTextPane();
Style def= textPane.getStyledDocument().addStyle(null, null);
StyleConstants.setFontFamily(def,"verdana");
StyleConstants.setFontSize(def,12);
Style normal= textPane.addStyle("normal", def);
Style s= textPane.addStyle("red", normal);
Style s1= textPane.addStyle("green", normal);
StyleConstants.setForeground(s, Color.RED);
StyleConstants.