I have a question about renaming a file by selecting JFileChoosr * , but I have found it very difficult to find an answer to my problem.
JFileChooser selecto = (JFileChooser) e.getSource();
String comand = e.getActionCommand();
if (comand.equals(JFileChooser.APPROVE_SELECTION)) {
File rutaActual = selecto.getSelectedFile();
selecto.getSelectedFile().renameTo(new File(selecto.getSelectedFile(), "nuevoNombre.jpg"));
System.out.println("Path: " + selecto.getSelectedFile().getPath());
That's the code I have so far and my intention as I said is to rename any selected file, in my case a jpg file
Any help will be welcome.