I was looking at this question and I was looking at the first answer.
So I tried to use this code:
public static Image getIcon(String fileName) throws Exception {
File file = new File(fileName);
FileSystemView view = FileSystemView.getFileSystemView();
Icon icon = view.getSystemIcon(file);
ImageIcon imageIcon = (ImageIcon) icon;
Image image = imageIcon.getImage();
return image;
}
Which does return an Image
(or throws an Error
) but the Image
has terribly low resolution.
I am assuming that this is because the 16x16 Image
is returned.
Is there any way to state which Image
I want to be returned?