Using JTextPane to format text blocks with XML tags
843806Aug 7 2007 — edited Aug 20 2007Hi,
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