How to gray out the files in JFileChooser?

Discussion in 'Java' started by RC, Apr 25, 2007.

  1. RC

    RC Guest

    I only let user select the directories,
    not let user select the files.

    So I

    myFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    That is fine, but user complain about that, they want to
    make sure there are files under the directory.

    If I do

    myFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

    Then user will mistake select a file, which I don't let them select a
    file. I need to popup a dialog says "Please select a directory only".

    The idea thing is I can gray out the file names, so user can see
    there are files under a directory, but they can't select any file,
    only can select a directory.

    Anyone out there has any idea how to gray out the file names in
    JFileChooser?

    Thank Q!
     
    RC, Apr 25, 2007
    #1
    1. Advertising

  2. RC

    derek Guest

    derek, Apr 25, 2007
    #2
    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. Davef

    gray out textbow clietside?

    Davef, Aug 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    Davef
    Aug 15, 2003
  2. Replies:
    5
    Views:
    11,160
    I82Much
    Jun 3, 2009
  3. RC
    Replies:
    2
    Views:
    14,625
    Roedy Green
    Apr 11, 2006
  4. Chris Lincoln
    Replies:
    1
    Views:
    581
    Alexey Smirnov
    Jul 2, 2007
  5. =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=

    gray out or disable underlying page on click

    =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=, Jul 11, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    546
    Kevin Spencer
    Jul 11, 2007
Loading...

Share This Page