I'm trying to figure out the best way to obtain AttributedString objects from a Swing component. It seems like the Swing text components that allow you to work with styled text store their text in a StyledDocument class or something similar.
What I would really like is to find a way to obtain AttributedString object from these components. Is there a way to do this directly? How about indirectly? I took a look at the Javadoc for StyledDocument, and it appears its getText methods return plain Strings, which means I would loose the styling information.