Paul Clapham wrote:Were you under the impression that the name of a variable which contains a reference to an object is automatically the name of that object?
No. Objects don't have names. Variables do have names, but you can't get those names by looking at objects to which the variables happen to refer at the current time.
I guess I did. I can retrive other characteristics of the object pointed to by
jtf so I thought "why not the name", especially as there is a getName() method (and so many others). Now I see that it is not possible but for my immediate purpose it's just fine. I would have had to parse the name since I have several JTextFields with similar names but all I want is the sub strings "SensorA", "SensorB", etc.. I'll just name them.