private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: FileDialog nameBox; nameBox = new FileDialog(this, "Save Peptides",FileDialog.SAVE); nameBox.setVisible(true); String fileDirectory = nameBox.getDirectory(); String savename = nameBox.getFile(); savename = fileDirectory.concat(savename); JTextPane in = jTextPane3; try (PrintWriter pWriter = new PrintWriter(new FileWriter(savename))) { pWriter.println(in); } catch (IOException ex) { Logger.getLogger(VeiwJFrame.class.getName()).log(Level.SEVERE, null, ex); } }
this brings up my filechooser and allowes to to save the file only problem is is saves
"javax.swing.JTextPane[,0,-15,6144x44,layout=javax.swing.plaf.basic.BasicText UI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,bor der=javax.swing.plaf.basic.BasicBorders$MarginBord er@1c1e333,flags=296,maximumSize=,minimumSize=,pre ferredSize=,caretColor=sun.swing.PrintColorUIResou rce[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResourc e[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIRes ource[top=3,left=3,bottom=3,right=3],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],kit=javax.swing.text.html.HTMLEditorKit@f53870,ty peHandlers={text/html=javax.swing.text.html.HTMLEditorKit@f53870, text/plain=javax.swing.text.StyledEditorKit@14c4ac9}]
"
instead of the text insided the jtextpanel.
any help would be appreciated.