Setting an image for a swing action :
Action action = ...
// ImageIcon icon = new ImageIcon(getClass().getResource(\"/icon.ico\"));
ImageIcon icon = new Imag
The supported types might change by manufacturer and version, though you can usually count on PNG, JPG & GIF.
import javax.imageio.ImageIO;
public class QuickTest {
public static void main(String[] args) throws Exception {
String[] types = ImageIO.getReaderFileSuffixes();
System.out.println("This JRE supports image types:");
for (String type : types) {
System.out.println("Type: " + type);
}
}
}
This JRE supports image types:
Type: bmp
Type: jpg
Type: wbmp
Type: jpeg
Type: png
Type: gif