This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've tried to disable the create new folder and rename for a JFileChooser. I know I can use the client property FileChooser.readOnly. I've experiencing some difficulties using that.
Because I only wanted to change the property for one specific file chooser, i've tried:Unfortunately that does not work. But this way i've alread used successfully :
I know I can useBut I don't want to fool arround with the UIManager.
In case you are wondering how I knew what the Action name was check out the article on Key Bindings.
Joined: Jun 01, 2011
Hi Rob, thank you for your solution. Unfortunately its not exactly what I'm looking for. I want to remove the 'New Folder' option from the menue and disable the rename functionality for files/folders. (when you double click the file/folder slowly, you can rename it.)
That's what setting the client property should do.
Thank you anyway.
Joined: Jun 13, 2009
I see what you mean. I"ve searched all through the source code and can't figure out how the "readOnly" property affects the ability to rename a file.
I suggest you use the UIManager for this. I don't see any downside to your original approach.