NullPointerException Java help

Posted by KP65 on Stack Overflow See other posts from Stack Overflow or by KP65
Published on 2010-04-19T21:29:59Z Indexed on 2010/04/19 21:33 UTC
Read the original article Hit count: 274

Filed under:
|

Hello guys. I've been tearing my hair out the past few hours trying to solve this problem. Every time I click on a JButton which should open a JFrame(And it does), i get a stacktrace saying I have a null point exception at these bits of code:

In class A i have:

  aButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
      B instanceofB = new B(userSession.getBalance());

            });

and Class B

  super.getSomeBtn().setVisible(false);

This is where the stacktrace says the errors are in the two above sections. I have a line exactly the same as the one above in Class B and it works fine?

Really stuck here!

© Stack Overflow or respective owner

Related posts about java

Related posts about nullpointerexception