Package javax.swing

Examples of javax.swing.JFileChooser.showSaveDialog()


        return list.size() == 0 ? null : list;
    }

    public static void saveListToFile(Component component, List<String> list) {
        final JFileChooser fc = new JFileChooser();
        int ret = fc.showSaveDialog(SwingUtilities.getRootPane(component).getContentPane());
        if (ret == JFileChooser.APPROVE_OPTION) {
            FileWriter fw = null;
            File f = null;
            try {
                f = fc.getSelectedFile();
View Full Code Here


      fc.setSelectedFile(scrambler.getModuleData().getFile(KEY_UNSCRAMBLE_OUTPUT));

      boolean isSelecting = true;

      while (isSelecting) {
        if (JFileChooser.APPROVE_OPTION == fc.showSaveDialog(getOwner())) {
          final File output = fc.getSelectedFile();

          if (output.exists()) {
            if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(getOwner(),
                localizer.getValue(HelperResource.RES_TEXT_FILE_EXISTS_OVERWRITE), localizer.getValue(HelperResource.RES_TEXT_FILE_EXISTS), JOptionPane.WARNING_MESSAGE)) {
View Full Code Here

        jtaExportArea.setText("");
    }//GEN-LAST:event_jmiClearAllActionPerformed

    private void jbSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbSaveActionPerformed
        JFileChooser jfc = new JFileChooser();
        int rv = jfc.showSaveDialog(this);

        if (rv != JFileChooser.APPROVE_OPTION) {
            return;
        }
        File file = jfc.getSelectedFile();
View Full Code Here

      reportFileChooser.setCurrentDirectory(new File(ApplicationContext.getUserPreferences().getUserSelectedDir()));
    }
    reportFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    reportFileChooser.setMultiSelectionEnabled(false);
    reportFileChooser.setAcceptAllFileFilterUsed(false);
    reportFileChooser.showSaveDialog(ApplicationContext.getCurrentFrame());
    if (reportFileChooser.getSelectedFile() == null) {
      return;
    }
    String fileName = reportFileChooser.getSelectedFile().getAbsolutePath();
    reportService.saveReportData(reportForm, currentDataSource, fileName);
View Full Code Here

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setAcceptAllFileFilterUsed(false);
    int returnOption = fileChooser.showSaveDialog(ApplicationContext.getCurrentFrame());
    if (JFileChooser.CANCEL_OPTION == returnOption || JFileChooser.ERROR_OPTION == returnOption) {
      return;
    }
    if (fileChooser.getSelectedFile() == null) {
      return;
View Full Code Here

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setAcceptAllFileFilterUsed(false);
    int returnOption = fileChooser.showSaveDialog(ApplicationContext.getCurrentFrame());
    if (JFileChooser.CANCEL_OPTION == returnOption || JFileChooser.ERROR_OPTION == returnOption) {
      return;
    }
    if (fileChooser.getSelectedFile() == null) {
      return;
View Full Code Here

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setAcceptAllFileFilterUsed(false);
    int returnOption = fileChooser.showSaveDialog(ApplicationContext.getCurrentFrame());
    if (JFileChooser.CANCEL_OPTION == returnOption
        || JFileChooser.ERROR_OPTION == returnOption) {
      return;
    }
    if (fileChooser.getSelectedFile() == null) {
View Full Code Here

      fc.setSelectedFile(scrambler.getModuleData().getFile(KEY_SCRAMBLE_OUTPUT));

      boolean isSelecting = true;

      while (isSelecting) {
        if (JFileChooser.APPROVE_OPTION == fc.showSaveDialog(getOwner())) {

          final File output = fc.getSelectedFile();

          if (output.exists()) {
            if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(getOwner(),
View Full Code Here

    }
    fileChooser.setSelectedFile(f);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setAcceptAllFileFilterUsed(false);
    int returnOption = fileChooser.showSaveDialog(ApplicationContext.getCurrentFrame());
    if (JFileChooser.CANCEL_OPTION == returnOption
        || JFileChooser.ERROR_OPTION == returnOption) {
      return;
    }
    if (fileChooser.getSelectedFile() == null) {
View Full Code Here

                filePanel.setDialogType(JFileChooser.OPEN_DIALOG);
                retVal = filePanel.showOpenDialog(mainWindow);
                break;
            case SAVE:
                filePanel.setDialogType(JFileChooser.SAVE_DIALOG);
                retVal = filePanel.showSaveDialog(mainWindow);
                break;
            case SAVE_AS:
                filePanel.setDialogType(JFileChooser.SAVE_DIALOG);
                retVal = filePanel.showSaveDialog(mainWindow);
                break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.