Results 1 to 3 of 3
- 05-07-2012, 09:50 PM #1Banned
- Join Date
- Jan 2012
- Rep Power
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.
- 05-07-2012, 10: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, 10:17 PM #3
- By pbrockway2 in forum AWT / SwingReplies: 4Last Post: 05-26-2012, 11:09 AM
- By Ericyue in forum New To JavaReplies: 3Last Post: 04-09-2012, 02:07 PM
- By jojo in forum New To JavaReplies: 1Last Post: 05-16-2011, 01:19 PM
- By happytrails in forum New To JavaReplies: 4Last Post: 04-10-2009, 05:35 AM
- By Sam in forum AWT / SwingReplies: 0Last Post: 02-06-2008, 04:55 PM