Search in sources :

Example 1 with Image

use of com.vaadin.flow.component.html.Image in project flow by vaadin.

the class RouterLinkView method addImageLink.

private void addImageLink() {
    Anchor anchor = new Anchor("image/link", null);
    anchor.getElement().setAttribute("router-link", true);
    anchor.getStyle().set("display", "block");
    Image image = new Image("", "IMAGE");
    image.setWidth("200px");
    image.setHeight("200px");
    anchor.add(image);
    add(anchor);
}
Also used : Anchor(com.vaadin.flow.component.html.Anchor) Image(com.vaadin.flow.component.html.Image)

Aggregations

Anchor (com.vaadin.flow.component.html.Anchor)1 Image (com.vaadin.flow.component.html.Image)1