P
Phil...
I have a directory that has lots of jpg and gif files.
I want to delete all of the small ones, those with
height or width less than 100 px.
I use close to the following code to get the height and width.
File dir = new File(".");
String files[] = dir.list();
ImageIcon myimage = new ImageIcon(files);
int height = myimage.getIconHeight();
int width = myimage.getIconWidth();
At this point, File.delete() returns false
most of the time. My guess is that the file
is still open. How can I close it so I can delete it?
N.B. File.deleteOnExit() works fine.
Tnx, phil...
I want to delete all of the small ones, those with
height or width less than 100 px.
I use close to the following code to get the height and width.
File dir = new File(".");
String files[] = dir.list();
ImageIcon myimage = new ImageIcon(files);
int height = myimage.getIconHeight();
int width = myimage.getIconWidth();
At this point, File.delete() returns false
most of the time. My guess is that the file
is still open. How can I close it so I can delete it?
N.B. File.deleteOnExit() works fine.
Tnx, phil...