Ok, I'm pretty sure I'm overlooking something stupid...
I have a JFrame that opens, and on button-click, I open another JFrame. I would also like to hide the original JFrame.
My code looks something like:
The ActionPerformed() method triggers fine, but I can't seem to figure out what context to call
Whatever I try, it can't find it and sends me a java.lang.NullPointerException
Can someone help me out please?
I have a JFrame that opens, and on button-click, I open another JFrame. I would also like to hide the original JFrame.
My code looks something like:
Code:
public class someClass implements ActionListener
{
JFrame frame1;
JFrame frame2;
public someClass()
{
frame1 = new JFrame("frame1");
//blah
//blah
frame1.setVisible(true)
}
public void ActionPerformed(ActionEvent e)
{
frame1.setVisible(false);
frame2 = new JFrame("frame2");
//blah
//blah
frame2.setVisible(true);
}
}
The ActionPerformed() method triggers fine, but I can't seem to figure out what context to call
Code:
frame1.setVisible(false);
Can someone help me out please?