my dog learned polymorphism
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Remove "All Files" Dropdown from JFileChooser" Watch "Remove "All Files" Dropdown from JFileChooser" New topic

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

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



~ 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 ?
I agree. Here's the link:
subject: Remove "All Files" Dropdown from JFileChooser
It's not a secret anymore!