void finishInit() { // Create 3 styles associated with the text panes Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); StyleConstants.setFontFamily(def, "SansSerif"); Style regular0 = jTextPane.addStyle("regular", def); Style regular1 = commentPane.addStyle("regular", def); Style s0 = jTextPane.addStyle("old", regular0); Style s1 = commentPane.addStyle("old", regular1); StyleConstants.setBackground(s0, Color.yellow); StyleConstants.setBackground(s1, Color.yellow); s0 = jTextPane.addStyle("new", regular0); StyleConstants.setBackground(s0, Color.pink); s1 = commentPane.addStyle("new", regular1); StyleConstants.setBackground(s1, Color.pink); }