Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Attributes associated with text in a JTextPane

Posted on 2007-12-03
4
Medium Priority
?
758 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
2 Comments
 
LVL 92

Expert Comment

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

Accepted Solution

by:
sciuriware earned 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month20 days, 16 hours left to enroll

810 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