Ola Obrigado pelas respostas
Resultado do FIELD.GET(i) - NÃO ESTÁ RETORNANDO VALOR DO COMPONENTE
ESTÁ RETORNANDO PROPRIEDADES
Estou rodando este codigo para teste em um JFrame
String result = "";
Class cls = this.getClass();
result += "[[" + this.getClass().getName() + "[\n";
Field fieldlist[] = cls.getDeclaredFields();
for (int i = 0; i < fieldlist.length; i++) {
Field fld = fieldlist[i];
fld.setAccessible(true);
if (fld.getType().getSimpleName().equals("JTextField")){
comp = (Object) fld;
}
result += "field [\n";
result += "name = " + fld.getName() + "\n";
result += "type = " + fld.getType() + "\n";
int mod = fld.getModifiers();
result += "modifiers = " + Modifier.toString(mod) + "\n";
try {
result += "value = " + fld.get(this) + "\n";
} catch (IllegalArgumentException ex) {
Logger.getLogger(Cadastro.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(Cadastro.class.getName()).log(Level.SEVERE, null, ex);
}
result += "]\n";
}
result += "]" + "\n";
System.out.println(result);
Quando o componente é um JTestField o resultado de FIELD.GET(i) é
field [
name = ed_ENDER
type = class javax.swing.JTextField
modifiers = private
value = javax.swing.JTextField[,10,70,370x25,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1b04310,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=0,columnWidth=0,command=,horizontalAlignment=LEADING]
]