Salve, sto cercando di fare in modo che se clicco su un bottone questo mi apre un JFrame. Questo nuovo Jframe ha diversi campi e un bottone. Quando clicchi sul bottone allora aggiorna un arraylist con i campi compilati e crea un nuovo oggetto. Il problema è che devo aspettare che l'utente prema sul bottone per creare il nuovo oggetto. Così ho fatto in questo modo:

Bottone che se cliccato apre il nuovo frame
codice:
private JButton addFamiglia(){
		JButton add = new JButton("Aggiungi Familiare");
		add.addActionListener(new ActionListener() {
			public void actionPerformed( ActionEvent event ){
				ArrayList<String> nuoveInfo = new ArrayList<String>();
				FrameVeloce nuovo = new FrameVeloce(a, "Nuovo Familiare", "Nome", "URL", "Legame");
		while(nuovo.getstop());
				Pg nuovoFamiliare = new Pg(nuoveInfo.get(0), nuoveInfo.get(1), nuoveInfo.get(2), 1);
				listaFamiglia.put(nuoveInfo.get(0), nuovoFamiliare);
				Famiglia.setListData(listaFamiglia.keySet().toArray());
			}
		}
				);
		return add;
	}
Codice del frame generato
codice:
public class FrameVeloce extends JFrame{
	
	private ArrayList<String> output;
	private int y=0;
	private pagina pag;
	private boolean stop =true;

	public FrameVeloce(ArrayList<String> output, String titolo, String... testo){
		super(titolo);
		this.output=output;
		pag = new pagina();
		pag.c.weightx = 0.5;
		for(String a:testo){
			pag.c.fill = GridBagConstraints.NONE;
			pag.c.gridx=0;
			pag.c.gridy=y;
			pag.add(new JLabel(a), pag.c);
			pag.c.fill = GridBagConstraints.HORIZONTAL;
			pag.c.gridx=1;
			pag.add(new JTextField(), pag.c);
			y++;
		}
		
		addBottoneInvio();
		add(pag);
		setVisible(true);
		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        java.awt.Point center = ge.getCenterPoint();
        int w = 200;
        int h = 200;
        int x = center.x - w/2, l = center.y - h/2;
        setBounds(x, l, w, h);
		setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	}
	
	private void addBottoneInvio(){
		JButton b=new JButton("Invio");
		b.addActionListener(new ActionListener() {
			public void actionPerformed( ActionEvent event ){
				JPanel a = returnPanel();
				for(int j=1; j<a.getComponentCount(); j+=2){
					String z = ((JTextField)a.getComponent(j)).getText();
					output.add(z);
				}
				dispose();
				stop=false;
			}
		}
				);
		pagina a = returnPanel();
		a.c.gridx=0;
		a.c.gridy=y;
		a.c.gridwidth=2;
		a.add(b, a.c);
		
	
		
	}
	
	private pagina returnPanel(){return pag;}
	
	public boolean getstop(){return stop;}
Il problema è che se premo il bottone (quello del primo codice), il JFrame FrameVeloce non viene corettamente visualizzato e non potendo premere sul bottone, il programma non termina mai. Come posso fare?