Hi!
You can use any component as a layout for components.
So, to display the image in the center, you can create a flexLayout
as the root component. Then, simply add your image.
Here’s a code snippet:
@Supply(to = "usersDataGrid.username", subject = "renderer")
protected Renderer<User> usersDataGridUsernameRenderer() {
return new ComponentRenderer<>(FlexLayout::new, (flexLayout, user) -> {
flexLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER);
Image img = new Image();
img.setSrc("/icons/icon.png");
img.setHeight("2em");
img.setWidth("2em");
flexLayout.add(img);
});
Result:
Regards,
Dmitriy