开发者

How to forbid directory name editing in JFileChooser?

开发者 https://www.devze.com 2023-03-31 18:39 出处:网络
To browse directories in JFileChooser, users use double-click. The problem is, if they click not fast enough, file chooser thinks they want to edit directory name, 开发者_开发问答and it is very annoyi

To browse directories in JFileChooser, users use double-click. The problem is, if they click not fast enough, file chooser thinks they want to edit directory name, 开发者_开发问答and it is very annoying. Is there a way to disable directory name editing?


You could set the file chooser to be read only, if need be:

UIManager.put("FileChooser.readOnly", Boolean.TRUE);

Unfortunately, that also removes the 'new folder' button, if I am correct.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号