1

I'm using NetBeans to build a folder browser application. In application flow, i place a file browser control to browse files and folders.

My problem: The file browser control always list both folders and files.

My question: How can i set the file browser control to list only folders?

Minh Nguyen
  • 1,989
  • 3
  • 17
  • 30

1 Answers1

1

When you are looking for new list of files&folders to browse you can filter and only add folders:

while (enum1.hasMoreElements()) {
                    current = (String) enum1.nextElement();
                    if (current.endsWith("\") || current.endsWith("/")) {
                        folders.addElement(current);
                    }


         }
 }
frayab
  • 2,512
  • 20
  • 25