Loading...
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
TUTORIAL

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

How to extend a Button.ClickListener

Kai Klostermann
6 years ago Oct 30, 2015 3:20pm
Christopher Boyd
6 years ago Oct 30, 2015 7:40pm

Hi OddDeer,

have you considered using a runnable, and invoking the runnable in your ClickListener implementation?

Something like this:

unnable r = () -> System.out.println( "I'm a runnable button." );
            Button b = new Button();
            b.addClickListener( (e) -> r.run()); 
Kai Klostermann
6 years ago Nov 02, 2015 7:42am
Kai Klostermann
6 years ago Nov 02, 2015 9:15am
Christopher Boyd
6 years ago Nov 02, 2015 8:34pm