ImageIcon (EvaluationContext evaluationContext, Value obj, String methodName) { try { byte[] data = getImageBytes(evaluationContext, obj, methodName); if (data != null) { return new ImageIcon(data); } } catch (Exception e) { LOG.info("Exception while getting image data", e); } return null; }