cancel
Showing results for 
Search instead for 
Did you mean: 

Button with an image...

david_fryda2
Participant
0 Kudos

Hi everyone,

I am trying to put on a Button a jpeg.

This is the code :

Button bt1 = new Button("bt1");

bt1.setEncode(false);

bt1.setText("<img src=\"Winter.jpg\">");

The Winter.jpeg is located in the \dist\images folder.

When I run the iView, the image is not found.

Does anyone know how to deal with this.

Thank you.

View Entire Topic
Former Member
0 Kudos

Hi David,

try this:

bt1.setText("<img src=""+componentRequest.getWebResourcePath() + "/images/Winter.jpg">");

Kind regards

Francisco

Message was edited by: Francisco Villar