Results 1 to 1 of 1
Thread: need help SAVEAS
- 01-12-2008, 12:54 PM #1
Member
- Join Date
- Nov 2007
- Posts
- 12
- Rep Power
- 0
need help SAVEAS
i need help regard to menu saveAs:
my word processor only can save word that i inserted but cannot able to save image in the document...in short term, cannot save both word and image.just can save the word only..any one can help in this matter?
here i attach the code for SaveAs i created:
please feel free for correct this code...tqJava Code:private void SaveAs() { File fileToSave; JFileChooser fc = new JFileChooser(); fc.setDialogTitle (savemenu); fc.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); if(fc.showSaveDialog(OJMain.this)==0) { fileToSave = fc.getSelectedFile(); if(fileToSave.exists()) { existsDialog.showIt(); if (existsDialog.getDecision().equals("no")){ Save(); }else { try { File fout = new File (fc.getSelectedFile().toString() + type); FileOutputStream out = new FileOutputStream(fout); m_kit.write(out,tpOpenJawi.getStyledDocument(), 0, tpOpenJawi.getStyledDocument().getLength()); Saved_Once=fc.getSelectedFile(); saved_once=true; out.close(); this.setTitle("\u0627\u0648\u06A4\u064A\u0646\u0020\u062C\u0627\u0648\u064A"); } catch (Exception ex) { ex.printStackTrace(); System.out.println("error"); } } }else{ try { File fout = new File (fc.getSelectedFile().toString() + type); FileOutputStream out = new FileOutputStream(fout); m_kit.write(out,tpOpenJawi.getStyledDocument(), 0, tpOpenJawi.getStyledDocument().getLength()); Saved_Once=fc.getSelectedFile(); saved_once=true; out.close(); this.setTitle("\u0627\u0648\u06A4\u064A\u0646\u0020\u062C\u0627\u0648\u064A"); } catch (Exception ex) { ex.printStackTrace(); System.out.println("error"); } } fc.rescanCurrentDirectory(); } }


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks