Ir para conteúdo
  • 0

[Resolvido] [Interface]Urgente


Karamujo

Pergunta

18 respostass a esta questão

Posts Recomendados

São 2 frames diferentes??

Sim

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        telaConfig tc = new telaConfig();
        tc.setVisible(true);
        tc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        tc.setLocationRelativeTo(null);
    }       
 
e seto essas config nele o evento e o Performed
Link para o comentário
Compartilhar em outros sites

 

Sim

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        telaConfig tc = new telaConfig();
        tc.setVisible(true);
        tc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        tc.setLocationRelativeTo(null);
    }       
 
e seto essas config nele o evento e o Performed

 

To baixando e eclipse... vou ver...

Editado por leonardosc
Link para o comentário
Compartilhar em outros sites

Muda do EXIT ON CLOSE pra DISPOSE_ON_CLOSE

 

code d exemplo qfiz

	public static void main(String[] args)
	{
		
		JFrame frame = new JFrame("Janela principal");
		frame.setSize(600, 700);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		JButton b = new JButton();
		b.addActionListener(actionListener ->
		{
			JFrame frame2 = new JFrame("Janela 2");
			frame2.setSize(200, 200);
			frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
			frame2.setLocationRelativeTo(null);
			frame2.setVisible(true);
		});
		frame.add(b);
		
	}

http://prntscr.com/87qlxp

Editado por leonardosc
Link para o comentário
Compartilhar em outros sites

AH kkkkk

 

Tenta:

 

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

 

Ou:

 

DO_NOTHING_ON_CLOSE 

HIDE_ON_CLOSE 

 

Muda do EXIT ON CLOSE pra DISPOSE_ON_CLOSE

 

code d exemplo qfiz

	public static void main(String[] args)
	{
		
		JFrame frame = new JFrame("Janela principal");
		frame.setSize(600, 700);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		JButton b = new JButton();
		b.addActionListener(actionListener ->
		{
			JFrame frame2 = new JFrame("Janela 2");
			frame2.setSize(200, 200);
			frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
			frame2.setLocationRelativeTo(null);
			frame2.setVisible(true);
		});
		frame.add(b);
		
	}

http://prntscr.com/87qlxp

vlw viados e que demorei para testar

logo-forum.png

 

 

Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas.

 

 

Atenciosamente,

Gamer's Board

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem está navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...