Change the code to:public void _function( String target ) {this.target = "showForm";}I guess that you want to change the value of your private member andnot the value of the parameter that you pass over to this function.