saving the text in textpane in a file with styles.
i am creating a text editor using java swings concept
this is the code i am using to save a file
FileOutputStream fop=new FileOutputStream(fname);
where fname is the name given in save file chooser bye the user
jta is the text pane in which the text to be saved...
my problem is that it is saving the text but not the font style,color,etc...
how to do it .. i am stuck here,please help me...