Reputation: 1333
Hi there I am looking to parse an Object I have into a String so that I can enter it's value into a textfield. Here is a little snippet.
TFname is the name of the textfield
Object value = list.getSelectedValues();
TFname.setText(parseObject(value)); //-- Here I pick up an error
Where I pick up the error, I know it's because this isn't how you parse an object but I was wondering if anyone knew how I would go about doing it properly.
If anyone could help I would be very grateful.
Upvotes: 1
Views: 235
Reputation: 114767
list.getSelectedValues()
returns an Array of Objects. Try this code, if it fails, error details wouldbe helpful
Object[] value = list.getSelectedValues();
fName.setText(parseObject(value)); //-- Here I pick up an error
Note: I assume, there is this method in the same class:
String parseObject(Object[] values) {
// method body
}
Upvotes: 0