Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileNameExtensionFilter


        }
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Excel 2007 Files (*.xlsx)", "xlsx"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("Excel 97-2003 Files (*.xls)", "xls"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("CSV Files (*.csv)", "csv"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here


            chooser.setCurrentDirectory(new File(txtFilename.getText()));
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Graded Event Files", "xml"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here

            chooser.setCurrentDirectory(new File(txtFilename.getText()));
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Graded Event Files", "xml"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here

        }
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Graded Event Files", "xml"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here

        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        if (rBtnRaptor.isSelected())
        {
            chooser.setFileFilter(new FileNameExtensionFilter("RAPTOR Files", "rap"));
        } else
        {
            chooser.setFileFilter(new FileNameExtensionFilter("Java Archive Files", "jar"));
        }
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
View Full Code Here

            boolean showExtensionInDescription, String... extensions) {
        if (showExtensionInDescription) {
            description = createFileNameFilterDescriptionFromExtensions(
                    description, extensions);
        }
        return new FileNameExtensionFilter(description, extensions);
    }
View Full Code Here

  }

  private void doExportTree() {
    JFileChooser chooser = new JFileChooser();
    chooser.setSelectedFile(new File("./tree.png"));
    FileNameExtensionFilter filter = new FileNameExtensionFilter("PNG images", "png");
    chooser.setFileFilter(filter);

    int status = chooser.showSaveDialog(this);

    if (status != JFileChooser.APPROVE_OPTION)
View Full Code Here

        }
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Excel 2007 Files (*.xlsx)", "xlsx"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("Excel 97-2003 Files (*.xls)", "xls"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("CSV Files (*.csv)", "csv"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here

        else
            chooser.setCurrentDirectory(new File(txtLogFile.getText()));
        chooser.setMultiSelectionEnabled(false);
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Log Files", "log"));
        int result = chooser.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION)
        {
            try
            {
View Full Code Here

            chooser.setCurrentDirectory(new File(txtFilename.getText()));
        // We're only after directories, so set the chooser to only list directories
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        chooser.setMultiSelectionEnabled(false);
        chooser.resetChoosableFileFilters();
        chooser.setFileFilter(new FileNameExtensionFilter("Excel 2007 Files (*.xlsx)", "xlsx"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("Excel 97-2003 Files (*.xls)", "xls"));
        chooser.addChoosableFileFilter(new FileNameExtensionFilter("CSV Files (*.csv)", "csv"));
        int res = chooser.showOpenDialog(this);
        if (res == JFileChooser.APPROVE_OPTION)
        {
            try
            {
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.