Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to apply multiple filenamefilters to the same FileDialog object?

  1. #1
    Junior Member
    Join Date
    Mar 2022
    Posts
    15
    My Mood
    Sleepy
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default How to apply multiple filenamefilters to the same FileDialog object?

    I want to add two different filenamefilter to the same FileDialog object. My below code works, when I try to add more than one to the same FileDialog object, it breaks such that nothing seem as a file in the dialog window. How can I apply multiple file extension fil?
    I used below code to create my own filenamefilter class(snce FileNameFilter is actually interface).

     
    import java.io.*;
     
    public class FileExtensionFilter implements FilenameFilter {
        private String extension;
     
        public FileExtensionFilter(String extension) {
            this.extension = extension;
     
        }
     
        @Override   
        public boolean accept(File dir, String filename) {
             return filename.toLowerCase().endsWith(this.extensions);
        }
    }

  2. #2
    Junior Member
    Join Date
    Dec 2022
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to apply multiple filenamefilters to the same FileDialog object?

    The team should also be able to provide technical support and maintenance for the software https://mlsdev.com/services/it-staff-augmentation. This includes providing updates and bug fixes as needed. The team should also be able to provide training and support to users of the software.
    Last edited by marcopalme; January 17th, 2023 at 04:45 PM.

Similar Threads

  1. Building DOM object from multiple threads
    By gdev in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 22nd, 2014, 03:19 PM
  2. Replies: 1
    Last Post: October 25th, 2013, 10:43 PM
  3. Pressing Cancel in FileDialog close entire application (Using SWT)
    By Avatar19 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 3rd, 2013, 01:22 PM
  4. How to apply RowFilter in JXTreeTable
    By skmoorthy02 in forum AWT / Java Swing
    Replies: 2
    Last Post: January 27th, 2011, 12:49 PM
  5. FileDialog with JFrame
    By nigi10 in forum AWT / Java Swing
    Replies: 3
    Last Post: December 3rd, 2010, 10:20 AM

Tags for this Thread