JFileChooser - File Filter - Need help getting rid of "All Files" option

Discussion in 'Java' started by nbuserx@netbeans.org, Jan 28, 2005.

  1. Guest

    Hi all,

    I would really like to know how to get rid of the option "All
    Files" inside the JFileChooser, I have my own filter applied so
    that it only can see directories and *.mdb files but... the "All
    Files" option still is there, I would like to get rid of it
    altogether.

    Any help please.

    Thanks, Asif

    ----------------------------------------------
    Posted with NewsLeecher v1.0 Final
    * Binary Usenet Leeching Made Easy
    * http://www.newsleecher.com/?usenet
    ----------------------------------------------
    , Jan 28, 2005
    #1
    1. Advertising

  2. mprudhom Guest

    mprudhom, Jan 28, 2005
    #2
    1. Advertising

  3. Guest

    Re: JFileChooser - File Filter - Need help getting rid of "All Files" option - Thanks mprudhom

    ----------------------------------------------
    Posted with NewsLeecher v1.0 Final
    * Binary Usenet Leeching Made Easy
    * http://www.newsleecher.com/?usenet
    ----------------------------------------------
    , Jan 28, 2005
    #3
  4. I82Much

    Joined:
    May 5, 2009
    Messages:
    3
    Hi folks:

    I know this is an old topic, but it's relevant to me. My problem is that you can still select the greyed out items and choose the "OK" button. So for instance, I am filtering to only accept .3DS file extensions. But it will let you select any file that doesn't have that extension, it's just greyed out, and then you click OK and it acts as if it were a legitimate .3DS file (from the point of view of the file chooser)

    Any idea how to fix this?
    I82Much, May 5, 2009
    #4
  5. deea

    Joined:
    Jun 3, 2009
    Messages:
    1
    Hi I82Much!

    I do not know if you fixed the problem. It seems to me that there should be a problem with your filter. In my opinion you should see just the files with .3DS extension. Seeing the code would help a lot...
    deea, Jun 3, 2009
    #5
  6. I82Much

    Joined:
    May 5, 2009
    Messages:
    3
    The filter seems to work fine; I will attach the code and you can see for yourself, as well as a screenshot of what I mean

    http: //pastebin.com/f4cc5acc0


    http: //web5.twitpic.com/img/10997124-5597f583c2b002b714b0a2252eb682cd.4a26c855-scaled.png

    http: //web1.twitpic.com/img/10997167-8c2cb0b7f03481ae0f33a1c53eaad144.4a26c878-scaled.png

    http: //web5.twitpic.com/img/10997226-e0103534c59fe994db811f2475f4e157.4a26c897-scaled.png

    As you can see, even though the .txt files are greyed out, you can click them and select them.
    I82Much, Jun 3, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand Gopinath

    JFileChooser and file filter events

    Anand Gopinath, May 27, 2004, in forum: Java
    Replies:
    0
    Views:
    820
    Anand Gopinath
    May 27, 2004
  2. Cas
    Replies:
    5
    Views:
    777
    Kevin Jones
    Aug 28, 2006
  3. Allen
    Replies:
    6
    Views:
    8,207
    Mean Mike
    Sep 18, 2013
  4. Ramon F Herrera
    Replies:
    3
    Views:
    458
    Ramon F Herrera
    Nov 13, 2007
  5. jimgardener

    need advice using swing jfilechooser

    jimgardener, Oct 27, 2010, in forum: Java
    Replies:
    6
    Views:
    787
    jimgardener
    Oct 28, 2010
Loading...

Share This Page