- Joined
- Jul 2, 2011
- Messages
- 2,161
Hello
I am busy making an error report for all my programs and I want the program to print out the values of all the components along with their names.
However.
Components do not have names by default, resulting in null unless I code in the name which would be perfectly useless.
My question is, how does java identify components if it doesn't name them? If I could get an ID even if it is very obscure, I could at least use that information to search for the values of components I'm looking for.
Some of my components have over 80 different components or generate even more, naming them in code isn't really an option.
///
code:
for(int ko=0;ko<GameBack.getComponentCount();ko++){
System.out.println(GameBack.getComponent(ko).getName);
//result null
}
//however if I set name
Box1.setName("Box1");
//result Box1
if Java doesn't see the component as Box1 what does it see it as?????
//////////////////////////////////////////////////////////////////
Solved!
I am busy making an error report for all my programs and I want the program to print out the values of all the components along with their names.
However.
Components do not have names by default, resulting in null unless I code in the name which would be perfectly useless.
My question is, how does java identify components if it doesn't name them? If I could get an ID even if it is very obscure, I could at least use that information to search for the values of components I'm looking for.
Some of my components have over 80 different components or generate even more, naming them in code isn't really an option.
///
code:
for(int ko=0;ko<GameBack.getComponentCount();ko++){
System.out.println(GameBack.getComponent(ko).getName);
//result null
}
//however if I set name
Box1.setName("Box1");
//result Box1
if Java doesn't see the component as Box1 what does it see it as?????
//////////////////////////////////////////////////////////////////
Solved!
Last edited: