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 3 of 3

Thread: File.listFiles(FileFilter) won't compile

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default File.listFiles(FileFilter) won't compile

    Why won't the following compile?

    FileFilter ff = new FileNameExtensionFilter("...");
    File[] files = new File("...").listFiles(ff);

    Says that there is no listFiles(FileFilter) method of File, but the documentation begs to differ. Using JDK 6 / Eclipse 7.


  2. #2
    Junior Member vsbait's Avatar
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: File.listFiles(FileFilter) won't compile

    i am getting the same problem

  3. #3
    Member OutputStream's Avatar
    Join Date
    Apr 2011
    Posts
    32
    My Mood
    Fine
    Thanks
    1
    Thanked 4 Times in 3 Posts

    Default Re: File.listFiles(FileFilter) won't compile

    That method wants a java.io.FileFilter while you're trying to give it a javax.swing.filechooser.FileFilter.

  4. The Following 2 Users Say Thank You to OutputStream For This Useful Post:

    GrantMRobinson (June 28th, 2011), JavaPF (June 28th, 2011)

Similar Threads

  1. Cannot get to compile
    By theoneyouenvy in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 19th, 2011, 10:17 PM
  2. Cannot get to compile
    By Goff256 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 19th, 2011, 01:09 PM
  3. [SOLVED] I CANT COMPILE
    By savvas in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 31st, 2011, 11:34 AM
  4. *why won't this compile?*
    By dcshoecousa in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 2nd, 2010, 07:18 PM
  5. need help to compile
    By hardwarewizard in forum Java Theory & Questions
    Replies: 0
    Last Post: February 14th, 2010, 10:03 AM