JFileChooser - multiple file filters?

烂漫一生 提交于 2019-12-04 03:57:26

I think you want the addChoosableFileFilter method. Read the tutorial.

You can simply create a filter that subclasses FileFilter and call the method I outlined above with that filter as an argument.

I'm sure you have already solved this to your satisfaction, but I came across this link at the same time I came across your question. In particular, look at section 3 for a way to generate multiple filters easily.

use

filter.addChoosableFileFilter(new FileNameExtensionFilter(description, extensions));

as many as the number of your extensions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!