Style changes and text in JTextPane

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Burrows

    Style changes and text in JTextPane

    I have a JTextPane with several styles. The style data is loaded from/
    saved to a file.

    I can modify the styles at run-time and the new styles are saved to disk.
    The next time the app is run the new styles are applied. What I need to
    do is to have them change in the styledDocument which is currently
    showing but I can't seem to make it happen. I can change the font
    face/size and it changes immediately, but bold/italic and foreground don't
    change. What is really odd is that I have a baseStyle which is the only
    one with the font and size info, and several children. When I change font
    or size, all text with a child style changes, but text using baseStyle
    stays unchanged!

    Can anyone tell me how to get the italic/bold/colour to change on the fly
    and why the baseStyle text doesn't change its font and size?

    Tony
Working...