How do I add image to GWT Button or how do I use Mosaic's Buttons to add image. I can't figure out how to use THIS example in my code. What library do I need to add. I have Mosaic Library in my project and I can use it but the example that they have there does not work for me.
Thanks
If you just want to add an image to a normal GWT Button, then PushButton is the way to go:
PushButton pushButton = new PushButton(new Image("test.png"));
PushButton does not have the same behavior, and you have a prettier solution than creating yourself an image tag :
Image img = new Image("whatever.jpg");
Button button = new Button();
button.getElement().appendChild(img.getElement());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With