My idea is to open this window as a parameter without losing any attribute, for example, I have the class:
public class Teste {
JFrame janela = new JFrame;
public ControllerJPreTransacao(JFrame janela) {
this.janela = janela;
initEvents();
}
private void initEvents(){
janela.setVisible(true); //NullPointerException
}
}
As you might note, in a certain part of the class eclipse accuses NullPointerException
on the line that leaves janela
visible, which does not make sense since I instantiated it at the beginning of the class. Due to this error the eclipse does not even open the frame. What am I missing?