Ajuda com JInternalFrame

Pessoal é o seguinte tenho uma aplicação que dentro de um JDesktopPane chamo um JInternalFrame, e dentro deste JInternalFrame tem um botão que chama outro JInternalFrame pra dentro do JDesktopPane, Utilizando o metodo getParente() . O problema é o seguinte não consegui controlar o segundo JInternalFrame de forma correta, por exemplo, depois que fecho este, ele não abre mais. e tambem não consegui posiciona-lo no meio da tela segue os codigos fonte da aplicação.

Primeiro JInternalFrame sendo chamado dentro do JDesktopPane

		jMenuItem = new JMenuItem();
			jMenuItem.setText("Cadastrar");
			jMenuItem.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					 
					if (iframe == null){
						iframe = ae.mostrar(); // A classe ae é a classe que retornao JInternalFrame
						iframe.setVisible(true);
						int x = jDesktopPane.getWidth()/2 - iframe.getWidth()/2;
						int y = jDesktopPane.getHeight()/2 - iframe.getHeight()/2;
						iframe.setLocation(x,y);
						jDesktopPane.add(iframe);	
					}else{
						iframe.setVisible(true);
						jDesktopPane.moveToFront(iframe);
						int x = jDesktopPane.getWidth()/2 - iframe.getWidth()/2;
						int y = jDesktopPane.getHeight()/2 - iframe.getHeight()/2;
						iframe.setLocation(x,y);
					}
									
				}
			});

			
		

Segundo JInternalFrame sendo chamado dentro do Primeiro JInternalFrame

if (JIframe == null){
						
						JIframe = cq.mostrar(); //Classe responsavel por retornar o segundo JInternalFrame
						JIframe.setVisible(true);
						int x = ((JDesktopPane) getParent()).getWidth()/2 - JIframe.getWidth()/2;
						int y = ((JDesktopPane) getParent()).getHeight()/2 - JIframe.getHeight()/2;
						JIframe.setLocation(x, y);
						JIframe.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
						JIframe.setLocation(100, 50);
						((JDesktopPane) getParent()).add(JIframe);
						((JDesktopPane) getParent()).moveToFront(JIframe);
						
					}
					else{
						int x = ((JDesktopPane) getParent()).getWidth()/2 - JIframe.getWidth()/2;
						int y = ((JDesktopPane) getParent()).getHeight()/2 - JIframe.getHeight()/2;
						JIframe.setVisible(true);
						JIframe.setLocation(x, y);						
						((JDesktopPane) getParent()).moveToFront(JIframe);
					}