Its finished

This commit is contained in:
Eric-Turner
2016-05-22 09:19:11 -04:00
parent 6ac2df4555
commit c7dc9a4661
+12 -12
View File
@@ -153,20 +153,20 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
String randString = StringUtils.randomString(10);
boolean search = true;
boolean duplicate = false;
while(search == true){
for (File f : Directories.getScreenshotDir().listFiles()){
if (f.getAbsoluteFile().getName().contains(randString)) {
duplicate = true;
break;
}
}
if (!duplicate){
search = false;
} else {
randString = StringUtils.randomString(10);
duplicate = false;
while (search == true) {
for (File f : Directories.getScreenshotDir().listFiles()) {
if (f.getAbsoluteFile().getName().contains(randString)) {
duplicate = true;
break;
}
}
if (!duplicate) {
search = false;
} else {
randString = StringUtils.randomString(10);
duplicate = false;
}
}
File file = new File(Directories.getScreenshotDir().getPath() + "/" + randString + ".png");
ImageIO.write(image, "png", file);