@Override
  protected Void doInBackground()
  {
    JSONArray arr = null;
    if (directURL != null)
      return directDownload();

    try
    {

      String search = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=";
      if (customSearch != null)
        search += customSearch.replace(" ", "+");
      else
        search += button.getText().replace(" ", "+");

      URL url = new URL(search);

      URLConnection connection = url.openConnection();

      String line;
      StringBuilder builder = new StringBuilder();
      BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      while ((line = reader.readLine()) != null)
        builder.append(line);

      JSONObject obj = new JSONObject(builder.toString());
      arr = obj.getJSONObject("responseData").getJSONArray("results");

    } catch (IOException ex)
    {
      Logger.getLogger(IconDownloader.class.getName()).log(Level.SEVERE, null, ex);
    }

    BufferedImage newImage;
    if (arr != null)
      for (int i = 0; i < arr.length(); i++)
      {
        String string = arr.getJSONObject(i).getString("url");
        try
        {
          newImage = ImageIO.read(new URL(string));
        } catch (IOException ex)
        {
          Logger.getLogger(IconDownloader.class.getName()).log(Level.SEVERE, null, ex);
          continue;
        }

        BufferedImage image = transform(newImage);
        button.setImage(image);
        return null;
      }

    button.setIcon(Utils.getUnknownIcon());

    return null;
  }