Package javax.swing

Examples of javax.swing.JFileChooser


   */
  public PrintToImage() {
   
    if(JSynoptic.gui!=null){
      File currentDirectory = CurrentPathProvider.currentPathProvider.getCurrentPath();
      printFileChooser = new JFileChooser(currentDirectory);
     
      Iterator it=formatsMap.keySet().iterator();
      FileFilter preferredFilter=null;
      while(it.hasNext()){
        String v=(String)it.next();
View Full Code Here


        if(classes==null){
          classes=new HashMap();
        }
        classes.put(extDescClass[i][0],c);
        if(chooser==null){
          chooser=new JFileChooser();
          chooser.setAcceptAllFileFilterUsed(false); // don't want all
          filters=new HashMap();
        }
        final int r=i;
        FileFilter ff=new FileFilter(){
View Full Code Here

      mainSwitch.setChildMask(bs);
     
    }else if (action.equals(NodeResourcesManager.getResources().getStringValue("SaveAs"))) {
      //   Select a Systema file
      Java3DPlugin3DFileFilter filter = new Java3DPlugin3DFileFilter();
      JFileChooser chooser = new JFileChooser();
      chooser.setAcceptAllFileFilterUsed(false);
      chooser.setFileFilter(filter);
     
      int returnVal = chooser.showDialog(null, NodeResourcesManager.getResources().getString("SaveAs"));
      if (returnVal == JFileChooser.APPROVE_OPTION){
       
        File f = chooser.getSelectedFile();
        fileName = new String();
        String sceneName = new String();
       
        if (f.getAbsolutePath().indexOf(".") != -1){
          fileName = f.getAbsolutePath().substring(0,f.getAbsolutePath().indexOf("."));
View Full Code Here

    });
   
    // ------------------------------------------------------------
    final MainWindow _this = this;
   
    final JFileChooser file_chooser;
      FileSystemView file_system_view;
        file_system_view = FileSystemView.getFileSystemView();
        file_chooser = new JFileChooser( file_system_view );
        file_chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        file_chooser.setMultiSelectionEnabled(false);
        file_chooser.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            if(event.getActionCommand() == JFileChooser.APPROVE_SELECTION) { 
                  final File file = file_chooser.getSelectedFile();
                  (new JMThread(new JMRunnable() {
                   public void JMRun() {
                    try {
                   _server_manager.importList(file.getAbsolutePath());
                 } catch (Throwable e) {
                   e.printStackTrace();
                     SwingUtilities.invokeLater(new Runnable() {
                       public void run() {
                          JOptionPane.showMessageDialog(_this, "An error occured, most probably the file format is wrong", "Error Message",JOptionPane.ERROR_MESSAGE)
                       }
                     })
                   }  
                   }
                  })).start();

            }
          }
        });
       
   
    import_server_list.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent event) {
         System.out.println("Import server list entered");
         file_chooser.showDialog(_this, "Choose");  
       }
    });
   
    new_downloads.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
View Full Code Here

    }
   
    if (action.equals(NodeResourcesManager.getResources().getString("Open"))) {
      // Select a Systema file
      Java3DPlugin3DFileFilter filter = new Java3DPlugin3DFileFilter();
      JFileChooser chooser = new JFileChooser();
      chooser.setAcceptAllFileFilterUsed(false);
      chooser.setFileFilter(filter);
     
      int returnVal = chooser.showDialog(null, NodeResourcesManager.getResources().getString("Open"));
      if (returnVal == JFileChooser.APPROVE_OPTION){
        loadJava3dScene(chooser.getSelectedFile());
     
    }
  }
View Full Code Here

    if (JSynoptic.gui==null) {
      return FileSerializer.readFromString(fileName, CurrentPathProvider.currentPathProvider.getCurrentPath());
     
    }else {
      if (fileChooser==null){
        fileChooser = new JFileChooser();
        initializeFileChooser();
        if (filter!=null){
          fileChooser.setFileFilter(filter);

          // Add an accessory panel
View Full Code Here

            }
        }

        // Set up Directory chooser
        File currentPath = CurrentPathProvider.currentPathProvider.getCurrentPath();
        exporthelpDirectoryChooser = new JFileChooser(currentPath);
        exporthelpDirectoryChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        exporthelpDirectoryChooser.setDialogTitle(resources.getString("selectExportdirectory"));
    }
View Full Code Here

        providers.put(jmi, new ContextualActionProvider() {
          public String[] getActions(double x, double y, Object o, int context) {return null;}
          public boolean canDoAction(double x, double y, Object o, String action, int context) {return true;}
          public boolean doAction(double x, double y, Object o, String action, CompoundEdit undoableEdit) {

            JFileChooser fc;

            if(JSynoptic.gui instanceof JSynopticPanels){
              fc =((JSynopticPanels)JSynoptic.gui).getFileChooser();
            }else{
              fc = new JFileChooser();
            }
            if (link!=null) fc.setSelectedFile(new File(link));
            int res = fc.showDialog(JSynoptic.gui.getOwner(), messageWriter.print0args("SelectLink"));
            if (res!=JFileChooser.APPROVE_OPTION) return false;
            File f = fc.getSelectedFile();
            if ((f==null) || (!f.exists())) {
              JSynoptic.setStatus(messageWriter.print1args("CannotSetLinkInvalidFile",f.getName()));
              return false;
            }
            try {
View Full Code Here

            // Here's the code that brings up the dialog.
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // Set up the file chooser.
                    if (SvgShapePropertiesPanel.fileChooser == null) {
                        SvgShapePropertiesPanel.fileChooser = new JFileChooser();
                        // Add a custom file filter and disable the default
                        SvgShapePropertiesPanel.fileChooser.setAcceptAllFileFilterUsed(true);
                        // add the optionnal (Accept All) file filter.
                        SvgShapePropertiesPanel.fileChooser.addChoosableFileFilter(new SvgFileFilter());
                        // Add the preview pane.
View Full Code Here

        bChoose = new JButton(resources.getString("Choose"));
        bChoose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // Set up the file chooser.
                if (fileChooser == null) {
                    fileChooser = new JFileChooser();
                    // Add a custom file filter and disable the default
                    fileChooser.setAcceptAllFileFilterUsed(false);
                    // add the optionnal (Accept All) file filter.
                    fileChooser.addChoosableFileFilter(new SvgFileFilter());
                    // Add the preview pane.
View Full Code Here

TOP

Related Classes of javax.swing.JFileChooser

Copyright © 2018 www.massapicom. 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.