[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Attributes associated with text in a JTextPane

Posted on 2007-12-03
4
Medium Priority
?
757 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

649 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