Program: 57572
Project: 57572
Buggy source:
public void processImages() throws IOException {
  DefaultCaret caret=(DefaultCaret)OutputTxtArea.getCaret();
  caret.setUpdatePolicy(ALWAYS_UPDATE);
  if (CopyXXHDPIChk.isSelected()) {
    xxhdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!xxhdpiDirectory.exists()) {
      xxhdpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      System.out.println(fileList[i].getName());
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 4);
        float scaleY=(float)(img.getHeight() / 4);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        if (finalScaleX == 0) {
          finalScaleX=1;
        }
        if (finalScaleY == 0) {
          finalScaleY=1;
        }
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(xxhdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkLDPI.isSelected()) {
    GenerateProgressBar.setString("String_Node_Str");
    ldpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!ldpiDirectory.exists()) {
      ldpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      System.out.println(fileList[i].getName());
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 4);
        float scaleY=(float)(img.getHeight() / 4);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        if (finalScaleX == 0) {
          finalScaleX=1;
        }
        if (finalScaleY == 0) {
          finalScaleY=1;
        }
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(ldpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkMDPI.isSelected()) {
    mdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!mdpiDirectory.exists()) {
      mdpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 3);
        float scaleY=(float)(img.getHeight() / 3);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(mdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkTVDPI.isSelected()) {
    tvdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!tvdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      tvdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 2.3);
        float scaleY=(float)(img.getHeight() / 2.3);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(tvdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkHDPI.isSelected()) {
    hdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!hdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      hdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 2);
        float scaleY=(float)(img.getHeight() / 2);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(hdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkXHDPI.isSelected()) {
    xhdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!xhdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      xhdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 1.5);
        float scaleY=(float)(img.getHeight() / 1.5);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(xhdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  OutputTxtArea.append("String_Node_Str");
  GenerateButton.setEnabled(true);
  chkHDPI.setEnabled(true);
  chkXHDPI.setEnabled(true);
  chkLDPI.setEnabled(true);
  chkMDPI.setEnabled(true);
  BrowseButton.setEnabled(true);
  PrefixCheckbox.setEnabled(true);
  FileField.setEnabled(true);
  if (PrefixCheckbox.isSelected()) {
    PrefixText.setEnabled(true);
    CopyXXHDPIChk.setEnabled(true);
  }
}

Fixed version (ground truth):
public void processImages() throws IOException {
  DefaultCaret caret=(DefaultCaret)OutputTxtArea.getCaret();
  caret.setUpdatePolicy(ALWAYS_UPDATE);
  if (CopyXXHDPIChk.isSelected()) {
    xxhdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!xxhdpiDirectory.exists()) {
      xxhdpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      System.out.println(fileList[i].getName());
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth());
        float scaleY=(float)(img.getHeight());
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        if (finalScaleX == 0) {
          finalScaleX=1;
        }
        if (finalScaleY == 0) {
          finalScaleY=1;
        }
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(xxhdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkLDPI.isSelected()) {
    GenerateProgressBar.setString("String_Node_Str");
    ldpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!ldpiDirectory.exists()) {
      ldpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      System.out.println(fileList[i].getName());
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 4);
        float scaleY=(float)(img.getHeight() / 4);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        if (finalScaleX == 0) {
          finalScaleX=1;
        }
        if (finalScaleY == 0) {
          finalScaleY=1;
        }
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(ldpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkMDPI.isSelected()) {
    mdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!mdpiDirectory.exists()) {
      mdpiDirectory.mkdir();
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 3);
        float scaleY=(float)(img.getHeight() / 3);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(mdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkTVDPI.isSelected()) {
    tvdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!tvdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      tvdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 2.3);
        float scaleY=(float)(img.getHeight() / 2.3);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(tvdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkHDPI.isSelected()) {
    hdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!hdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      hdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 2);
        float scaleY=(float)(img.getHeight() / 2);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(hdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  if (chkXHDPI.isSelected()) {
    xhdpiDirectory=new File(originalDirectory.getParent() + "String_Node_Str" + PrefixText.getText()+ "String_Node_Str");
    if (!xhdpiDirectory.exists()) {
      OutputTxtArea.append("String_Node_Str" + PrefixText.getText() + "String_Node_Str");
      xhdpiDirectory.mkdir();
    }
 else {
      OutputTxtArea.append(PrefixText.getText() + "String_Node_Str");
    }
    int i;
    GenerateProgressBar.setMaximum(fileList.length);
    for (i=0; i < fileList.length; i++) {
      GenerateProgressBar.setValue(i);
      OutputTxtArea.append("String_Node_Str" + i + "String_Node_Str"+ fileList.length+ "String_Node_Str");
      System.out.println(fileList[i].getName());
      String fileName=fileList[i].getName();
      if (fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str") || fileName.contains("String_Node_Str")) {
        ext=fileName.substring(fileName.length() - 3);
        System.out.println(ext);
        BufferedImage img=ImageIO.read(fileList[i]);
        float scaleX=(float)(img.getWidth() / 1.5);
        float scaleY=(float)(img.getHeight() / 1.5);
        int finalScaleX=(int)scaleX;
        int finalScaleY=(int)scaleY;
        System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ finalScaleY+ "String_Node_Str"+ finalScaleX);
        Image newImg=img.getScaledInstance(finalScaleX,finalScaleY,Image.SCALE_SMOOTH);
        BufferedImage bImage=new BufferedImage(newImg.getWidth(null),newImg.getHeight(null),BufferedImage.TYPE_INT_ARGB);
        Graphics2D bImageGraphics=bImage.createGraphics();
        bImageGraphics.drawImage(newImg,null,null);
        RenderedImage rImage=(RenderedImage)bImage;
        File outputfile=new File(xhdpiDirectory + "String_Node_Str" + fileName);
        ImageIO.write(rImage,ext,outputfile);
      }
    }
    GenerateProgressBar.setValue(0);
    OutputTxtArea.append("String_Node_Str");
  }
  OutputTxtArea.append("String_Node_Str");
  GenerateButton.setEnabled(true);
  chkHDPI.setEnabled(true);
  chkXHDPI.setEnabled(true);
  chkLDPI.setEnabled(true);
  chkMDPI.setEnabled(true);
  BrowseButton.setEnabled(true);
  PrefixCheckbox.setEnabled(true);
  FileField.setEnabled(true);
  if (PrefixCheckbox.isSelected()) {
    PrefixText.setEnabled(true);
    CopyXXHDPIChk.setEnabled(true);
  }
}