Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFileChooser not showing any files or directories

843805Nov 27 2006 — edited Nov 28 2006
I'm trying to use a JFileChooser in LINUX to open up a file I will be reading in but the FileChooser does not show any directories or files for me to chose from. It's just and empty FileChooser Window. It has a couple options by the "Look In:" combobox, but again there is nothing to chose from in the window where the folders and files should show up.

The code i have is simple
JFileChooser fc;

...
...

if ("open".equals(e.getActionCommand()))
{
    if (fc == null)
    {
      fc = new JFileChooser();

      fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    }
}

int returnVal = fc.showOpenDialog(ScenExectureWindow.this);
Again the FileChooser window appears but I don't understand why it is not recognizing ANY files or folders...

Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2006
Added on Nov 27 2006
9 comments
1,196 views