I have a StyledDocument to which I am adding some style. I want to have some default (global) style that works for all the styles I create. For example a global background for all the style, so that I don't have to specify the background
for each style.
Here is how I am trying to achieve
public void setUpStyles() {
parentMSGStyle = historyPane.addStyle("parentmsgstyle", null);
userNameStyle = historyPane.addStyle("usernamestyle", parentMSGStyle);
StyleConstants.setBackground(parentMSGStyle, Color.GRAY);
StyleConstants.setForeground(userNameStyle, Color.BLUE);
}
This does not for now. Only the blue color style is working but not the "GRAY" one. I am new to StyledDocuments. Please point me to right direction.