The Paint2D component allows to create a graphic image using the graphic2D features of JDK. The attribute paint should point to a method of the bean that accept to parameters.

The first parameter has a Graphic2D type. I.e, it is a graphic canvas you can draw on.

The second parameter is your custom data you can pass to a paint method using a data attribute of the paint2D component. The Object type is using. So, you can use the bean of any type. The bean should be serializable.

To improve the performance and avoid the extra unnecessary traffic over the net, a generated image will be cached if the data is not changed. You can turn this feature off with a cacheable attribute.

Paint2D demo