Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javax.swing.JFileChooser jF1 = new javax.swing.JFileChooser();
- String ruta = "home/luis/Documentos";
- try{
- if(jF1.showSaveDialog(null)== jF1.APPROVE_OPTION){
- ruta= jF1.getSelectedFile().getAbsolutePath();
- //Aqui creas el archivo
- }
- }
- catch(Exception ex){
- ex.printStackTrace();
- }
- String ruta = "home/luis/Documentos";
- File archivo = new File(ruta);
- BufferedWriter bw;
- if(archivo.exists()) {
- // El fichero ya existe
- } else {
- // El fichero no existe y hay que crearlo
- bw = new BufferedWriter(new FileWriter(archivo));
- bw.close(); // Debe cerrarse la escritura del fichero
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement