2

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

fdurmus77
  • 516
  • 7
  • 21
  • possible duplicate of [Vaadin : How to change favicon?](http://stackoverflow.com/questions/25660659/vaadin-how-to-change-favicon) – cfrick Sep 11 '15 at 10:39

4 Answers4

6

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"));
Henri Kerola
  • 4,947
  • 1
  • 17
  • 19
1
Image image = new Image();
image.setSource(new ExternalResource("http://www.maski.gov.tr/Maski.PNG")); 
image.setWidth("207px");
image.setHeight("80px");
akash
  • 22,664
  • 11
  • 59
  • 87
0

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)
Chris M
  • 1,058
  • 1
  • 15
  • 26
0

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);
Aaron
  • 55,518
  • 11
  • 116
  • 132