code: public static JComponent generateComponent(Image image) {
  
          if (image == null) {
              return new LabelUIResource("Image is null");
          }
  
          return SwingUtils.generateComponent(new ImageIcon(image));
      }
docs: Generates a component to view an image.
  
  @param image
  the image.
  @return the component.