I have the following code
DefaultListModel<String> modelPacientes = new DefaultListModel<>();
JList <String> listPacientes = new JList<>( modelPacientes );
listPacientes.setToolTipText("Lista de los pacientes del doctor");
GridBagConstraints gbc_listPacientes = new GridBagConstraints();
gbc_listPacientes.fill = GridBagConstraints.BOTH;
gbc_listPacientes.gridx = 0;
gbc_listPacientes.gridy = 0;
pPacientes.add(listPacientes, gbc_listPacientes);
modelPacientes.addElement(raul.getName() + " " + raul.getSurname());
modelPacientes.addElement(paula.getName() + " " + paula.getSurname());
modelPacientes.addElement(sara.getName() + " " + sara.getSurname());
I am modifying the values of the objects (raul, paula and sara) in another frame, how could I update it in the JList or anywhere else (JLabel) after closing the other frame?