Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser options

 
Pres Brawner
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFileChooser does some cool stuff. However, I don't need all of the behaviors that come as default.
It is possible to pick and choose what you get?
I just want to look at directories.
I don't want to see things in list or details format.
Since I am just dealing with directories, I want to change the text that talks about File and refer to Directory.
Thanks all,
Pres
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pres,
There is a mode available in JFileChooser to let you specify if a user can select a file, directory, or both. I think you can use that to perform what you want.
Regards,
Manfred.
 
Basatwar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) for instance of your file chooser dialog... and get ur expected result...
Ritesh Basatwar
 
Pres Brawner
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the helpful advice.
The thing about the Directories only is great!
However, I still need to change the text of the automatic messages (so I can internationalize them)
I don't want to see the "Display as List" icon
I don't want to see the "Display Details" icon
I don't wnat to see the "Files of type" label or input box.
Should I try to subclass?
Thanks,
Pres
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic