You have a few different options:
- Use an object like StringBuilder, which stores a string that is modifiable.
- Wrap your string in a custom object which can be final, acts like a place holder.
- ...
I generally use number 2, unless of coarse I am modifying the string, then a StringBuilder should be used.
public class StringPlaceHolder {
public String theString = null;
}
public final StringPlaceHolder placeHolder = new StringPlaceHolder();
..your click handler..
public void onClick(ClickEvent event) {
...
placeHolder.theString = something;
}
This code may not be exactally correct, but should get the point across.