Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileNameExtensionFilter


        txtMessage = new javax.swing.JTextField();
        jLabel5 = 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


  private class ImageFileLoader extends JFileChooser {
    protected int result;
    public ImageFileLoader(Component parent, String imageDirectoryPath){
    super(imageDirectoryPath);
    this.setFileSelectionMode(FILES_ONLY);
    this.setFileFilter(new FileNameExtensionFilter("Images","png","gif","bmp","jpg"));
    this.setAcceptAllFileFilterUsed(false);
    this.setDialogTitle(rb.getString("Choose a simple image to convert"));
    result=this.showOpenDialog(parent);
    }
View Full Code Here

  private int result, headingCount;

  public GameLoader(Component parent, String puzzleDirectoryPath) {
    super(puzzleDirectoryPath);
    this.setFileSelectionMode(FILES_ONLY);
    this.setFileFilter(new FileNameExtensionFilter("Gnonogram Puzzles","gno"));
    this.setDialogTitle("Choose a puzzle");
    result=this.showOpenDialog(parent);
  }
View Full Code Here

    //private static final long serialVersionUID = 1;
    public GameSaver(Component parent, String puzzleDirectoryPath, String filename){
    super(puzzleDirectoryPath);
  if (filename!=nullthis.setSelectedFile(new File(puzzleDirectoryPath,filename));
    this.setFileSelectionMode(FILES_ONLY);
    this.setFileFilter(new FileNameExtensionFilter("Gnonogram Puzzles","gno"));
    this.setDialogTitle("Save the puzzle");
    result=this.showSaveDialog(parent);
  }
View Full Code Here

    /* The file chooser for setting log file. */
    private class SaveLogFileChooser extends JFileChooser {
        private static final long serialVersionUID = -3035086973026766211L;

        public SaveLogFileChooser() {
            setFileFilter(new FileNameExtensionFilter("CSV files", "csv"));
        }
View Full Code Here

    }//GEN-LAST:event_cioButtonActionPerformed

    private void loadSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadSettingsButtonActionPerformed
        JFileChooser fc = new JFileChooser();
        fc.setAcceptAllFileFilterUsed(false);
        FileNameExtensionFilter fnef = new FileNameExtensionFilter("SMT Processing Settings (*.sps)", "sps");
        fc.addChoosableFileFilter(fnef);

        // Let the user chose a settings file
        if( fc.showDialog(this, "Load Processing Settings") == JFileChooser.APPROVE_OPTION ) {
            try {
View Full Code Here

           this.settings.setProperty( "config.outputProcessor.options." + fpOption, fp.getOption(fpOption));
        }

        JFileChooser fc = new JFileChooser();
        fc.setAcceptAllFileFilterUsed(false);
        FileNameExtensionFilter fnef = new FileNameExtensionFilter("SMT Processing Settings (*.sps)", "sps");
        fc.addChoosableFileFilter(fnef);

        // Let the user chose a settings file
        if( fc.showDialog(this, "Save Processing Settings") == JFileChooser.APPROVE_OPTION ) {
            try {
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = new JFileChooser();
                VirtualFile baseDir = project.getBaseDir();
                if (baseDir != null) {
                    fileChooser.setCurrentDirectory(new File(baseDir.getPath()));
                    FileNameExtensionFilter fn;
                    if (CommonHelper.isWindows()) {
                        fileChooser.setFileFilter(new FileNameExtensionFilter("Yiic.bat file", "bat"));
                        fileChooser.setName("yiic.bat");
                    } else {
                        fileChooser.setFileFilter(new FileNameExtensionFilter("Yiic.php file", "php"));
                        fileChooser.setName("yiic.php");
                    }
                    fileChooser.setAcceptAllFileFilterUsed(false);
                    int ret = fileChooser.showDialog(null, "Открыть файл");
                    if (ret == JFileChooser.APPROVE_OPTION) {
View Full Code Here

      @Override
      public void actionPerformed(final ActionEvent ae) {

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));

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

          if(!fileName.endsWith(".rif")) {
            fileName += ".rif";
          }
          DocumentEditorPane.this.visualRifEditor.getSaveLoader().export(fileName);
        }
      }
    });

    final JMenuItem importMI = new JMenuItem("Import Document");
    importMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));

        if(chooser.showDialog(DocumentEditorPane.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();
          DocumentEditorPane.this.visualRifEditor.importNewDocument(FileHelper.fastReadFile(fileName));
        }
View Full Code Here

    // create JMenuItem to load a new query from a file...
    final JMenuItem newQueryFMI = new JMenuItem("Load query from a file");
    newQueryFMI.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileFilter(new FileNameExtensionFilter(
            "Query Files", "txt"));

        if (fileChooser.showOpenDialog(myself) == JFileChooser.APPROVE_OPTION) {
          try {
            // evaluate query and show graph...
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.