private void logicSaveFile() {
        JFileChooser jfc = new JFileChooser();
        jfc = setFilters(jfc, true, "sintax file (*.stx)", "stx");
        jfc.setMultiSelectionEnabled(false);
        jfc.setVisible(true);
        boolean repeat = true;
        int Guardar;
        do {
            Guardar = jfc.showSaveDialog(this);
            if(Guardar == JFileChooser.APPROVE_OPTION){
                if (jfc.getSelectedFile().exists()) {
                    int res = JOptionPane.showConfirmDialog(this, "Are you sure to overwrite the file?",
                           "WARNING", JOptionPane.YES_NO_OPTION, 
                           JOptionPane.WARNING_MESSAGE);
                    if (res == JOptionPane.YES_OPTION) {
                        repeat = false;
                        saveFile(jfc, "");
                    } else {repeat = true;}
                } else {
                    repeat = false;
                    jfc.setSelectedFile(new File(getValidName(jfc.getSelectedFile().toString(),
                            getExtension(jfc.getFileFilter()))));
                    saveFile(jfc, "." + getExtension(jfc.getFileFilter()));
                }
            }
        } while (repeat && !(Guardar == JFileChooser.CANCEL_OPTION));
    }