Package javax.swing

Examples of javax.swing.JFileChooser.showSaveDialog()


  public void actionPerformed(ActionEvent e) {
    Object o=e.getSource();
    if ( o==jb_save){
      PrintStream ps=System.out;
      JFileChooser jfc=new JFileChooser();
      if (jfc.showSaveDialog(null)==JFileChooser.APPROVE_OPTION & jfc.getSelectedFile()!=null){ 
      try{
        ps=new PrintStream(new java.io.FileOutputStream(jfc.getSelectedFile()));
        System.out.println("Save remote log into \""+jfc.getSelectedFile().getName()+"\""); }
      catch (FileNotFoundException fnfe){
        System.out.println("err : "+fnfe); }
View Full Code Here


          }
          catch (Exception ex) {
            ex.printStackTrace();
          }
        }
        if (chooser.showSaveDialog(centerPanel) == JFileChooser.APPROVE_OPTION) {
          File file = chooser.getSelectedFile();
          new FlameWriter().writeFlame(getCurrFlame(), file.getAbsolutePath());
          getCurrFlame().setLastFilename(file.getName());
          showStatusMessage(getCurrFlame(), "flame saved to disc");
          prefs.setLastOutputFlameFile(file);
View Full Code Here

          }
          catch (Exception ex) {
            ex.printStackTrace();
          }
        }
        if (chooser.showSaveDialog(centerPanel) == JFileChooser.APPROVE_OPTION) {
          QualityProfile qualProfile = getQualityProfile();
          ResolutionProfile resProfile = getResolutionProfile();
          final Flame flame = getCurrFlame();
          final File file = chooser.getSelectedFile();
          prefs.setLastOutputImageFile(file);
View Full Code Here

      chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    } else {
      chooser.setFileFilter(getFileNameExtensionFilter());
    }
   
    int returnVal = chooser.showSaveDialog(null);
 
    if (returnVal == JFileChooser.APPROVE_OPTION) {
     
      File selectedFile = chooser.getSelectedFile();
     
View Full Code Here

  private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_saveButtonActionPerformed
    JFileChooser jfc = new JFileChooser();
    jfc.setDialogTitle("Save to file");

    int ret = jfc.showSaveDialog(this);
    if (ret == JFileChooser.APPROVE_OPTION) {
      ObjectOutputStream oout = null;
      try {
        String filename = jfc.getSelectedFile().getAbsolutePath();
        if (!filename.endsWith(".jkms")) {
View Full Code Here

        }
        catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      if (chooser.showSaveDialog(windowMenu) == JFileChooser.APPROVE_OPTION) {
        File file = chooser.getSelectedFile();
        prefs.setLastOutputImageFile(file);
        if (buffer.getBufferType() == BufferType.IMAGE) {
          new ImageWriter().saveImage(buffer.getImage(),
              file.getAbsolutePath());
View Full Code Here

        }
        catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      if (chooser.showSaveDialog(windowMenu) == JFileChooser.APPROVE_OPTION) {
        File file = chooser.getSelectedFile();
        prefs.setLastOutputScriptFile(file);
        String filename = Tools.forceFileExt(file.getAbsolutePath(),
            Tools.FILEEXT_JFX);
        actionList.saveToFile(filename);
View Full Code Here

      JFileChooser chooser = getSceneJFileChooser();
      chooser.setCurrentDirectory(new File(prefs.getOutputSunflowScenePath()));
      if (currentFile != null) {
        chooser.setSelectedFile(new File(currentFile));
      }
      if (chooser.showSaveDialog(editorTextArea) == JFileChooser.APPROVE_OPTION) {
        File file = chooser.getSelectedFile();
        String filename = file.getAbsolutePath();
        switch (sceneType) {
          case JAVA:
            if (!filename.endsWith(".java")) {
View Full Code Here

          }
          catch (Exception ex) {
            ex.printStackTrace();
          }
        }
        if (chooser.showSaveDialog(rootPanel) == JFileChooser.APPROVE_OPTION) {
          File file = chooser.getSelectedFile();
          RGBPalette gradient = layer.getPalette().makeCopy();
          gradient.setFlam3Name(file.getName());
          new MapGradientWriter().writeGradient(gradient, file.getAbsolutePath());
          tinaController.showStatusMessage(gradient, "gradient saved to disc");
View Full Code Here

          }
          catch (Exception ex) {
            ex.printStackTrace();
          }
        }
        if (chooser.showSaveDialog(rootTabbedPane) == JFileChooser.APPROVE_OPTION) {
          final File file = chooser.getSelectedFile();
          prefs.setLastOutputImageFile(file);

          MeshGenGenerateThreadFinishEvent finishEvent = new MeshGenGenerateThreadFinishEvent() {
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.