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

查看:195
本文介绍了如何将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.

我应该如何要做到这一点吗?

How should I go about doing that?

推荐答案

你可以通过设置你自己的 FileSystemView

You can probably do this by setting your own FileSystemView.

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

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