如何将 JFileChooser 限制为一个目录? [英] How do I restrict JFileChooser to a directory?

查看:30
本文介绍了如何将 JFileChooser 限制为一个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的用户限制在一个目录及其子目录中,但父目录"按钮允许他们浏览到任意目录.

I want to limit my users to a directory and its sub directories but the "Parent Directory" button allows them to browse to an arbitrary directory.

我该怎么做?

推荐答案

你或许可以通过设置你自己的FileSystemView.

You can probably do this by setting your own FileSystemView.

这篇关于如何将 JFileChooser 限制为一个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆