I am trying to open a browse window using JFileChooser in java swing . By default its showing the all extension files when i browse the directory. But my requirement is
JFileChooser should browse the files with specific extensions.
Try that:
JFileChooser fileChooser = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter("XLS files", "xls");
fileChooser.setFileFilter(filter);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.