Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileNameExtensionFilter


    }

    private File chooseFile() throws IOException {
        initializeSwing();
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter(
            "Archives", "jar", "war", "sar");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showOpenDialog(null);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
           return chooser.getSelectedFile();
View Full Code Here


    public void run() {
        // public void apamStart() {
        System.out.println("starting injector");

        JFileChooser fileChooser = new JFileChooser();
        FileFilter filter = new FileNameExtensionFilter("*.properties",
                new String[] { "properties" });
        fileChooser.setFileFilter(filter);
        int returnVal = fileChooser.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
View Full Code Here

  private File askFile() {

    JFileChooser chooser = new JFileChooser(lastPath);
    chooser.setDialogTitle("Open OSM file");
    chooser.setFileFilter(new FileNameExtensionFilter(
        "OpenStreetMap data files", "osm", "gz", "bz2", "pbf"));

    int returnVal = chooser.showOpenDialog(null);

    if (returnVal == JFileChooser.APPROVE_OPTION) {
View Full Code Here

        KeyEvent.VK_PRINTSCREEN, ActionEvent.CTRL_MASK));

  }

  protected FileNameExtensionFilter getFileNameExtensionFilter() {
    return new FileNameExtensionFilter("PNG image files", "png");
  }
View Full Code Here

        KeyEvent.VK_P, ActionEvent.CTRL_MASK));

  }

  protected FileNameExtensionFilter getFileNameExtensionFilter() {
    return new FileNameExtensionFilter("POVRay source files", "pov");
  }
View Full Code Here

    putValue(MNEMONIC_KEY, KeyEvent.VK_O);

  }

  protected FileNameExtensionFilter getFileNameExtensionFilter() {
    return new FileNameExtensionFilter("Wavefront .obj files", "obj");
  }
View Full Code Here

                Integer.valueOf(19000), Integer.valueOf(20000)
        };
        ComponentTestImpl.checkpoints = new HashSet(Arrays.asList(temp));

        JFileChooser fileChooser = new JFileChooser();
        FileFilter filter = new FileNameExtensionFilter("*.properties",
                new String[] { "properties" });
        fileChooser.setFileFilter(filter);
        int returnVal = fileChooser.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
View Full Code Here

    loadMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent ae) {
        JFileChooser chooser = new JFileChooser(PATH_RULEFILES);
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));

        if(chooser.showDialog(that, "Load") == JFileChooser.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          that.saveLoader.load(fileName);
        }
      }
    });

    // create JMenuItem to save...
    JMenuItem saveMI = new JMenuItem("Save");
    saveMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent ae) {
        SaveDialog chooser = new SaveDialog(PATH_RULEFILES);
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));

        if(chooser.showDialog(that, "Save") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".json")) {
View Full Code Here

        lblUploadCursor = new javax.swing.JLabel();
        txtUploadCursor = new javax.swing.JTextField();
        btnChooseFile = new javax.swing.JButton();

        fileChooser.setDialogTitle("Select Image");
        FileNameExtensionFilter fnef = new FileNameExtensionFilter
        ("Image File","jpeg","JPEG","bmp","BMP","jpg","JPG","gif","GIF","png","PNG");
        fileChooser.addChoosableFileFilter(fnef);
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setAcceptAllFileFilterUsed(false);
        fileChooser.setFileFilter(fnef);
View Full Code Here

        txtMessage = new javax.swing.JTextField();
        titleCoverScreen = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        fileChooser.setDialogTitle("Select Image");
        fileChooser.addChoosableFileFilter(new
            FileNameExtensionFilter("Image File","jpeg","JPEG"
                ,"bmp","BMP","jpg","JPG","gif","GIF"));
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);

        jLabel1.setText("Background Color : ");
View Full Code Here

TOP

Related Classes of javax.swing.filechooser.FileNameExtensionFilter

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.