Threaded View

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    0
    newtogxt3 is on a distinguished road

      0  

    Default Answered: How to create ImageResource?

    Answered: How to create ImageResource?


    It's not clear to me how to create/use ImageResource. I'm trying to create a button and give it an icon like this:

    TextButton button = new TextButton();
    button.setIcon( anImageResource ) -- and this is what I've no idea how to do.

    Please help. Thanks.

  2. Here's how we do it:

    public interface Images extends ClientBundle {


    public Images INSTANCE = GWT.create(Images.class);


    @Source("foo.png")
    ImageResource foo();

    ...
    }

    Note that the PNG would need to be in the same package directory as the class.