Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2005

Tip: Looking for answers? Try searching our database.

JTextPane does not reapply styles when document changes,,,

Thread view: 
A - 22 Nov 2005 01:57 GMT
I have a simple program where a JTextPane displays a number of HTML files
in a directory. Each of these HTML files has a style sheet linked to it
through the <LINK tag.

I read in all the HTML files  into a list of documents and display them
based on some input event from the jtextpane. I use setdocument to display
each document and settext to display the text in it.

The first time that I display the document it shows up with all the
specified styles, but the next time I goback to an already displayed
document, the styles are all lost. Except for the background color, which
remains what I set it with the style.

I dont quite understand when the JTextPane redraws the styles for the
document, apparently doing a setDocument followed by a setText(0,
doc.length.. does not reapply the attributes.
I am missing something very elementary here ?

Thanks for your inputs
Andrew Thompson - 24 Nov 2005 14:59 GMT
> I am missing something very elementary here ?
...
A reproducible example that uses valid HTML/CSS?

Signature

Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.