I am using the following code, and I am trying to call an action from another action.
// Full code: https://github.com/neorai/Notepad/blob/master/src/notepad/Notepad.java
private void MenuGuardarActionPerformed(java.awt.event.ActionEvent evt) {
if ("nuevo".equals(MenuNuevo.getName())) {
MenuGuardarComoActionPerformed(evt); //<-- problem
}else{
try {
File fileToSave = jFileChooser1.getSelectedFile(); // ruta del archivo a leer
FileWriter escribir;
escribir = new FileWriter(fileToSave.getAbsolutePath(), true);
escribir.write(TextArea.getText()); // escribir en archivo
jTabbedPane1.setTitleAt(0, jFileChooser1.getName(fileToSave)); //establecer el nombre del archivo en pestaña de jtabbedpanel, 0 es la posicion de la pestaña en el array
escribir.close(); //cerrar archivo
} catch (IOException ex) {
Logger.getLogger(Notepad.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
How could I call that action from another action?