package eg.ui;

import javax.swing.ImageIcon;
import java.net.URL;

/**
 * The creation of an icon
 */
public class IconBuilder {
   
   /**
    * Creates an <code>ImageIcon</code>
    *
    * @param path  the path of the file that contains the icon
    * @return  the <code>ImageIcon</code> or null if no file can be found
    */
   public ImageIcon createIcon(String path) {
      URL imgURL = getClass().getResource(path);
      if (imgURL != null) {
         return new ImageIcon(imgURL);
      }
      else {
         return null;
      }
   }
}

@@ -127,12 +127,9 @@
 r %7B%0A
-   
 %0A
+
    /
@@ -259,66 +259,17 @@
 rn  
-the %3Ccode%3EImageIcon%3C/code%3E or null if no file can be found
+ImageIcon
 %0A   
@@ -468,19 +468,107 @@
     
-return null
+throw new IllegalArgumentException(%0A               %22No image file was found in the specified path%22)
 ;%0A  

Update IconBuilder.java