Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Remove "All Files" Dropdown from JFileChooser

 
Ranch Hand
Posts: 510
Google Web Toolkit Eclipse IDE 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.
 
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
Google Web Toolkit Eclipse IDE 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.
 
He baked a muffin that stole my car! And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!