aspose file tools*
The moose likes I/O and Streams and the fly likes data saving question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "data saving question" Watch "data saving question" New topic
Author

data saving question

Code Monk
Greenhorn

Joined: Apr 25, 2003
Posts: 5
My scenario is this: I want to save the contents of a JTextArea to a file. If possible, I'd like to be able to have bold, italics, and underlined text in that JTextArea as well, and be able to save and restore it into my Java program. I'm not exactly sure the best way to do this. Serialization? XML Serialization? Or some other way I don't know about.
Perhaps someone could point me in the right direction? And if you need more information as to what I'm trying to do, or why, let me know.
Thanks,
Sean
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

JTextArea just displays plain text. You use JEditorPane or JTextPane to display formatted text. They can also read plain text, HTML or RTF files, so take your pick as to the on-disk representation. They use a EditorKit to do the actual reading/writing.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data saving question