• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 761
  • Last Modified:

Attributes associated with text in a JTextPane

I am able to "underline", "bold", "highlight", etc text or parts of text in a JTextPane, but what I want to do is store the attributes associated with the text so that when I display this same text at a later stage the "bold", "highlighted" items re-appear as they were originally before I saved them to the file

I use a JTextPane, AbstractDocument, DocumentFilter, etc

Somehow I must be able to get and store the AttributeSet associated with this text unless somehow it is embedded

Could someone please assist

Thanks

Reg Bray
0
racbray
Asked:
racbray
1 Solution
 
objectsCommented:
try serializing the StyledDocument
0
 
sciuriwareCommented:
If you set up the JTextPane for HTML, you will feed it with HTML,
so there is no need to do anything than literally store this HTML text.

;JOOP!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now