A
anoymus
Gast
Hallo,
evtl kann mir jemand helfen. mein jfilechooser zeigt mir absolut den save-dialog an:
evtl kann mir jemand helfen. mein jfilechooser zeigt mir absolut den save-dialog an:
Code:
JFileChooser fc = new JFileChooser();
fc.setDialogType(JFileChooser.SAVE_DIALOG);
int state = fc.showOpenDialog( null );
fc.validate();
File file = fc.getSelectedFile();
try{
System.out.println(file.getPath()+ file.getName());//
FileOutputStream fos = new FileOutputStream(file.getPath()+ file.getName());
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(jTextPane1.getStyledDocument());
oos.close();
fos.close();
}
catch (FileNotFoundException exc) {
System.out.println("File Not Found: " + file.getName());
}
catch (IOException exc) {
System.out.println("IOException: " + file.getName());
}