File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Remove Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Remove "All Files" Dropdown from JFileChooser" Watch "Remove "All Files" Dropdown from JFileChooser" New topic
Author

Remove "All Files" Dropdown from JFileChooser

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Hi all,
I need to customize a JFileChooser a bit .
first i want to Remove "All Files" Dropdown (the label "all files" and also the combobox) or make them invisible.
I also want to change the label for first Combobox " look in" into label text "where".
can some one show a way to do that ?

many thanks.
Anand Loni
Ranch Hand

Joined: Jan 20, 2006
Posts: 150
Hi,

You can remove all files filter from JFileChooser using following method of JFileChooser

setAcceptAllFileFilterUsed(false);

Regards,
Anand


~ Anand,
SCJP 1.5
SCWCD 1.5
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Thank you,
I managed to remove the "all files" drop down menu and it's corresponding Label.
I used a method that goes through the Components of JFileChooser get the component i want and make it invisible.
Now I'm still trying to change the "Look In" Label to String "where" .I want this to be done on a Mac OS platform. however when I run my code on windows/linux i'm able to find a reference to GLable "Look In" ; but when i run same method on Mac I don't get the debug Infos related to JLabel "Look In".
Any Ideas about this issue ?
thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remove "All Files" Dropdown from JFileChooser
 
Similar Threads
JFileChooser
JFileChooser
customize JFileChooser ?
Can't set the Location of FileDialog
Only accept a file type in JFileChooser ?