开发者

How set FilterExtensions for Swing JDialog?

开发者 https://www.devze.com 2023-01-16 22:17 出处:网络
Ho开发者_如何学Pythonw filter the files by extensions (in the screen), like this example thanks,

Ho开发者_如何学Pythonw filter the files by extensions (in the screen), like this example

thanks, celso.


You can use FileNameExtensionFilter to filter certain file extension in JFileChooser. The API doc for it gives a short example:

FileFilter filter = new FileNameExtensionFilter("JPEG file", "jpg", "jpeg");
JFileChooser fileChooser = new JFileChooser();
fileChooser.addChoosableFileFilter(filter);
0

精彩评论

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

关注公众号