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:
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();
}
}
please feel free for correct this code...tq