[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 759
  • 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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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