Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using JTextPane to format text blocks with XML tags

843806Aug 7 2007 — edited Aug 20 2007
Hi,

I am looking for a way to edit, including formatting a text block and store (persist) the text in a database e.g. MySQL using JDBC. The reverse direction should also be possible, i.e. recall at a subsequent date/time from the database with the same formatting having been maintained.

The 2nd. requirement is that the formatting in this text block should use XML tags, which are stored with the text in the database record.

I've checked out the example TextComponentDemo (http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html) and would like to use this functionality, i.e. the text formatting features to do the job.

I guess one obvious question is how, having formatted the text in this demo can I store (and retrieve) the result as a database field. In other words how is the formatting persisted (in the database) and how can/could it be replace with XML tags?

Can anyone help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2007
Added on Aug 7 2007
7 comments
310 views