Do it like this:
aTextField.setText((readMethod.invoke(ob, null)).toString());
The second argument to Invoke is the parameter that you want to pass to the called method. In your case, assuming its reading method and not requiring a parameter, this argument should be set to null.
Required toString()because setText expects a string. If the return type of the method you are calling is String, then you can directly give the return value Stringinstead of callingtoString
: @Thilo, java5 invoke , .
aTextField.setText((readMethod.invoke(ob)).toString());