1

I was wondering if there is a GUI file explorer package in java to save me some time.

I'm talking about anything like the window you would see when "Browsing" a file in windows for loading into a media player for example.

Something like this:

enter image description here

Please I am asking if a specific package or methods exist to accommodate this. Just saying Jframe and swing is not really what I am looking for.

user2998504
  • 75
  • 1
  • 5
  • 13
  • 2
    You mean like [JFileChooser](http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html)? In that case,also look [here](http://stackoverflow.com/questions/759376/alternative-to-jfilechooser) – fvu Mar 04 '14 at 01:32

2 Answers2

4

You are looking for http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html

    JFileChooser chooser = new JFileChooser();
    int option = chooser.showOpenDialog(SimpleFileChooser.this);
    if (option == JFileChooser.APPROVE_OPTION) {
      statusbar.setText("You opened " + ((chooser.getSelectedFile()!=null) ? chooser.getSelectedFile().getName():"nothing"));
    }
    else {
      statusbar.setText("You canceled.");
    }
m-szalik
  • 3,546
  • 1
  • 21
  • 28
0

I searched in Google for something like this however I must not have phrased it correctly.

We have java.awt.FileDialog that uses the native file system explorer(more user friendly) and like fvu said JFileChooser. A tutorial for http://www.tutorialspoint.com/awt/awt_filedialog.htm here.

user2998504
  • 75
  • 1
  • 5
  • 13