I am putting a JFileChooser
in my program, but that only takes images. So I decided to add filters:
import javax.swing.*;
public c
I am putting a JFileChooser in my program, but that only takes images.
For a list of types supported by that JRE on that OS, use ImageIO.
FileFilter imageFilter = new FileNameExtensionFilter(
"Image files", ImageIO.getReaderFileSuffixes());
bmp
jpg
jpeg
wbmp
png
gif
Note: don't hard-code that list! It might change from version to version, and OS to OS. E.G.
That list would have many more formats if jai was installed.