Oliver
Oliver

Reputation: 11

View a picture in GWT HTML

I want to know how to view a picture in a HTML?

Example:

HTML htmlS = new HTML(picture resource+"[加载中...]");

how can I write "picture resource" GWT code?

Upvotes: 1

Views: 507

Answers (2)

iftee
iftee

Reputation: 369

You can use the img tag in HTML widget..

Upvotes: 1

Ashwin Prabhu
Ashwin Prabhu

Reputation: 7634

Create an object of com.google.gwt.user.client.ui.Image and make a call to setUrl() with the URL of the image resource.

image.setUrl(GWT.getModuleBaseURL() + <relative path to image resource>)

Upvotes: 3

Related Questions