• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove "All Files" Dropdown from JFileChooser

 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

setAcceptAllFileFilterUsed(false);

Regards,
Anand
 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic