void (TextAttributes attributes) { Color myBackground = myMergedAttributes.getBackgroundColor(); if (myBackground == null || myDefaultBackground.equals(myBackground)) { myMergedAttributes.setBackgroundColor(attributes.getBackgroundColor()); } Color myForeground = myMergedAttributes.getForegroundColor(); if (myForeground == null || myDefaultForeground.equals(myForeground)) { myMergedAttributes.setForegroundColor(attributes.getForegroundColor()); } if (myMergedAttributes.getFontType() == Font.PLAIN) { myMergedAttributes.setFontType(attributes.getFontType()); } }