Hi everyone,
I have a weird problem. Currently i am using a jtextpane with the HTMLDocument class as its default document. I am tryin to change the
background colour of the htmldocument but still it does not seem to work. I cannot use the JTextPane's setBackground method as if i do that then i cannot save my document to disk as HTML file thus i am trying to change the background of the jtextpane by using the StyleConstants
Here is what i have been doing
public void setcolor()
{
Color Color1 = ColorChooser1.showDialog(fr, "Color Chooser", Color.white);
SimpleAttributeSet sas = new SimpleAttributeSet();
if(Color1 != null)
{
StyleConstants.setBackground(sas, Color1);
sas.addAttribute(HTML.Attribute.BGCOLOR, Color1);
}
}
The thing is when i use the above function nothing happens but compiles without any errors. Can anyone please help me out with this problem?
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West