Solved

Attributes associated with text in a JTextPane

Posted on 2007-12-03
4
752 Views
Last Modified: 2008-09-20
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
Comment
Question by:racbray
4 Comments
 
LVL 92

Expert Comment

by:objects
ID: 20394685
try serializing the StyledDocument
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 250 total points
ID: 20395856
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java SE 8u111  Lot of stuff broke 11 69
servlet requestdispatcher include and forward differences 1 30
hibernate insert example 13 28
Running JavaFX on JDeveloper 12C 1 31
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question