I need some help.Im making a program that utilizes a
JEditorPane to display content.I also want the user to be
able to save what he/she typed in.So,I use the following code to get all html/rtf/text
content from the EditorPane and write it to a file but it doesnt seem to work:

//retrive jeditorpane's currently displayed file name
File file=new File(jeditorpane.getPage().toString());

FileWriter fw=new FileWriter(file);

//retrive all content and write


If anyone has any suggestions,please reply.