public void actionPerformed(ActionEvent e){
  boolean ok;
  int retVal;
  if (m_ShowDialog || (m_Script.getFilename() == null)) {
    retVal=m_FileChooser.showSaveDialog(FileScriptingPanel.this);
    if (retVal != JFileChooser.APPROVE_OPTION)     return;
    ok=m_Script.saveAs(m_FileChooser.getSelectedFile());
  }
 else {
    ok=m_Script.save();
  }
  if (!ok) {
    if (m_Script.getFilename() != null)     JOptionPane.showMessageDialog(FileScriptingPanel.this,"Failed to save file '" + m_FileChooser.getSelectedFile() + "'!");
 else     JOptionPane.showMessageDialog(FileScriptingPanel.this,"Failed to save file!");
  }
 else {
    m_SaveAction.setEnabled(false);
  }
  notifyTitleUpdatedListeners(new TitleUpdatedEvent(FileScriptingPanel.this));
}

public void actionPerformed ( ActionEvent e ) { boolean ok ; int retVal ; if ( m_ShowDialog || ( m_Script . getFilename ( ) == null ) ) { retVal = m_FileChooser . showSaveDialog ( FileScriptingPanel . this ) ; if ( retVal != JFileChooser . APPROVE_OPTION ) return ; ok = m_Script . saveAs ( m_FileChooser . getSelectedFile ( ) ) ; } else { ok = m_Script . save ( ) ; } if ( ! ok ) { if ( m_Script . getFilename ( ) != null ) JOptionPane . showMessageDialog ( FileScriptingPanel . this , "Failed to save file '" + m_FileChooser . getSelectedFile ( ) + "'!" ) ; else JOptionPane . showMessageDialog ( FileScriptingPanel . this , "Failed to save file!" ) ; } else { m_SaveAction . setEnabled ( false ) ; } notifyTitleUpdatedListeners ( new TitleUpdatedEvent ( FileScriptingPanel . this ) ) ; }
fired when action got executed .
