fdurmus77
fdurmus77

Reputation: 516

How to add image logo with URL in vaadin

I use vaadin 7.5.3 I want to add logo my web site page top with logo Url : http://...../example.png

But I want to read image on internet URL

Upvotes: 2

Views: 4906

Answers (4)

Aaron
Aaron

Reputation: 57738

For anyone else who finds this answer while searching for a more recent version of Vaadin, this worked for me in Vaadin v24:

private Image iconImage = new Image();
String iconURL = "https://api.weather.gov/icons/land/day/few?size=medium";
iconImage.setSrc(iconURL);

Upvotes: 0

Chris M
Chris M

Reputation: 1068

Personally, I'd do something more simple. I'd add a label with some HTML like this.

Label logo = new Label("<a href=\"http://www.maski.gov.tr\"><img src=\"http://www.maski.gov.tr/Maski.PNG\"></a>", ContentMode.HTML)

Upvotes: 0

Adem Bakış
Adem Bakış

Reputation: 11

Image image = new Image();
image.setSource(new ExternalResource("http://www.maski.gov.tr/Maski.PNG")); 
image.setWidth("207px");
image.setHeight("80px");

Upvotes: 1

Henri Kerola
Henri Kerola

Reputation: 4967

You can use ExternalResource with the Image component to display an image from an external URL:

Image image = new Image();
image.setSource(new ExternalResource("http://www.maski.gov.tr/Maski.PNG"));

Upvotes: 6

Related Questions