开发者

How set FilterExtensions for Swing JDialog?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜