This is my idea. I have two JFrame form_guardarDatos
and form_mostrarDatos
. I want to save them in a hashMap and then use that hashMap to invoke them in a main class. For example to obtain the data to be saved by invoking
mapa['keyGuardarDatos'].getDatoAGuardar().getText();
In this case getDatoAGuardar()
is only in form_guardarDatos
.
If I'm not wrong in python I could pass a class as an instance and always get its attributes and methods within a list but I do not know if this is possible in java since to pass a parameter it is necessary to declare the type equal to its class .
Greetings and thanks for the support.