Example Depot

Useful code samples
  • Home
  • Java
  • Contact
  • Blog
Java » Java packages » javax.swing

Displaying Only Directories in a File Chooser Dialog

COPY
JFileChooser fileChooser = new JFileChooser(file); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

Related examples

Adding a Title to a Border
Centering a JFrame, JWindow, or JDialog on the Screen
Creating a Borderless Window
Creating a Color Chooser Dialog
Creating a Compound Border
Creating a File Chooser Dialog
Creating a JFrame
Creating a JFrame
Creating a JScrollPane Container
Creating a JSplitPane Container
Creating a JTabbedPane Container
Creating a Scrolling JList Component
Creating an Internal Frame
Creating an Internal Frame
Determining When a JFrame or JWindow Has Been Iconized or Maximized
Disabling the Close Button on a JFrame
Exiting an Application When a JFrame Is Closed
Firing Item Events
Iconifying and Maximizing a JFrame
Making a JFrame Non-Resizable
Painting the Background of a Container with an Image Pattern
Removing the Title Bar of a JFrame
Setting a Border
Setting the Bounds for a Maximized JFrame
Setting the Icon for a JFrame
Showing a Dialog Box
The Quintessential Swing User Interface

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.

Login | Terms of Use | Trademarks | Privacy Statement
Copyright © 2009 Example Depot. All Rights Reserved.