Please explain what "does't work" means?
The button ignores any clicks on it.
The code in the listener gives an exception
The code in the listener does the wrong thing.
???