Results 1 to 3 of 3
- 05-07-2012, 10:50 PM #1
Banned
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
How to get the rtf data from a JEditorPane (text/rtf) to store it in a database
I want to store the content of a JEditorPane with rtf data into the database so that I can retrieve it again and show it on the JEditorPane exactly as it was first created. For this, I need the actual rtf data, not just the text.
If I use jEditorPane1.getText(), I get null.
Eventually, I found jEditorPane1.getStyledDocument().getText(0,jEditor Pane1.getStyledDocument().getLength()) which returns the text, but without any formatting.
I'd need the text with the rtf formatting codes so that I keep the formatting.
Any ideas?
- 05-07-2012, 11:16 PM #2
Re: How to get the rtf data from a JEditorPane (text/rtf) to store it in a database
Read the API for RTFEditorKit
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 05-07-2012, 11:17 PM #3
Similar Threads
-
JEditorPane text disappears
By pbrockway2 in forum AWT / SwingReplies: 4Last Post: 05-26-2012, 12:09 PM -
read text data and store to array
By Ericyue in forum New To JavaReplies: 3Last Post: 04-09-2012, 03:07 PM -
sql: store data in list or constantly ask the database?
By jojo in forum New To JavaReplies: 1Last Post: 05-16-2011, 02:19 PM -
[SOLVED] CoinCounter Class - How do I store data in text file?
By happytrails in forum New To JavaReplies: 4Last Post: 04-10-2009, 06:35 AM -
Copy n' Paste in JEditorPane wraps text in new css..?
By Sam in forum AWT / SwingReplies: 0Last Post: 02-06-2008, 04:55 PM
Bookmarks