I have a small question. I am using a JFileChooser in one of my projects and I want to make it so that I cannot edit the file name. Is there any way to do this?

Recommended Answers

All 5 Replies

Maybe set a FileFilter that only accepts the file name you want. (ps Why do yiou want to use a filechooser and not allow the user to specify the file name???)

oh i think you misinterpreted my question. you know how if you click on a file, and then click it again after a while, you are presented with an opportunity to edit the name of the file? I dont want to do that.

I cannot find such option in API. If I'm correct you will achieve this only with your custom build JFileChooser. Is it worth to do it?

ya i looked through the api as well and could not find a method. Could i perhaps add some sort of listener for clicks and then override a method?

oh i think you misinterpreted my question. you know how if you click on a file, and then click it again after a while, you are presented with an opportunity to edit the name of the file? I dont want to do that.

Sorry, I misunderstood.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.