The specific doubt is that you create JRadioButton in a dynamic way, that is, depending on the amount that exists in an ArrayList. From the FileManager class the user information is brought and it is required to show in its respective JTextField. This is a code segment:
public void crearRadioButton(){
ManejadorArchivo manejador = ManejadorArchivo.getInstance();
ArrayList<Usuario> usuarios = manejador.getListaUsuarios();
JPanel panelUsuarios = new JPanel();
panelUsuarios.setLayout(new FlowLayout());
Component botones;
for(Usuario usr: usuarios){
botones = panelUsuarios.add(new JRadioButton((usr.toString())));
grupo.add((AbstractButton) botones);
}
panel.add(panelUsuarios, BorderLayout.CENTER);
panelUsuarios.setBounds(228, 11, 265, 378);
panel.setVisible(true);
}
What I need is that when choosing the name of a user through the JRadioButton I show all the information of a certain user selected in the JTexfield assigned (Name, Maternal surname, Last name).