Skip to main content

Easy file browser...?

1 reply [Last post]
Tom Forrest
Joined: 2006-02-17

Newbie at programming. Got a project at UNI. A part of it includes getting a txt-file. I was hoping to do it nicely, and was wondering if anyone knows an easy way to make a GUI (I can create the GUI), similar to the "browse" window, MS Windows comes up with when looking for a file. How do I create a browse-field, and show the contents of drives and folders...?

Thank you in advance.

Tom Forrest

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-08-22

Uhm...I'm a Swing newbie too...but I think what you are looking for is already there.

import javax.swing.filechooser.*;

Check out the Swing tutorial at the Sun site, it has a FileChooser section.