Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6435283

Create JFileChooser In a Detail or List View

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      Currently, JFileChooser only starts in its default list view.

      Now that Mustang has a sortable detail view, there needs to be a way to create a JFileChooser in a detail view instead of the default list view.

      JUSTIFICATION :
      The only way to accomplish this task would be to extend the class and write new constructors and methods. With the new sorting of the detail view, more people will use JFileChooser's detail view instead of the list view.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It would be nice to have class constructors and methods to change the view programmtically. This could be something like "JFileChooser fc = new JFileChooser( "/path/to/dir/", JFileChooser.DETAIL_VIEW );" or "fc.setFileView( JFileChooser.DETAIL_VIEW );"
      ACTUAL -
      The only way to accomplish this behaviour would be to extend the class and write your own code.

      ---------- BEGIN SOURCE ----------
      //Here are some example constants to set the view
      static final int LIST_VIEW = 0;
      static final int DETAIL_VIEW = 1;

      //Here are some example constructors
      JFileChooser fc = new JFileChooser( "/path/to/dir/", JFileChooser.DETAIL_VIEW );
      JFileChooser fc = new JFileChooser( JFileChooser.DETAIL_VIEW );
      JFileChooser fc = new JFileChooser( fileObject, JFileChooser.LIST_VIEW );

      //Here are some helper methods
      fc.setFileView( JFileChooser.DETAIL_VIEW );
      int currentView = fc.getFileView( );
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The only way to accomplish this behaviour would be to extend the class and write your own code.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: