Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Dynamic icon for a button...

Weiqiang Xiong
7 years ago Jun 29, 2015 10:15pm
Tatu Lund
7 years ago Jun 30, 2015 8:44am

The simplest way would be just changing the icon in the buttonClick method of the ClickListener. E.g. like the following.
final Button myButton = new Button ("A bug");
myButton.addClickListener(new Button.ClickListner() {
public void buttonClick(ClickEvent e) {