File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Java MVC ActionListener NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java MVC ActionListener NullPointerException" Watch "Java MVC ActionListener NullPointerException" New topic

Java MVC ActionListener NullPointerException

Mark Calen

Joined: Aug 10, 2013
Posts: 1
Hello, I'm still new at using MVC and using ActionListener is giving me an issue running the program in which case where the NullPointerException comes as output.

The aim is to have a back button which returns the user from the Second Menu to the Main Menu.

When i commented out this line on the Controller the error goes away. this.theView.addComBackButtonListener(new CompanyBackBtnListener());
Correct me if im wrong but i think it can't seem to find the CompanyBackBtnListener even if its there.

- Check for typos already.
- There are actionlisteners for the Main Menu working already. But the Second Menu does not work giving NullPointerException

I tried to narrow down the codings. If i miss any details If you have any solutions please show me how as i'm still learning Java. Thank You.

The View

The Controller


m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 174
please whats wrong with answers on another question, another place
I agree. Here's the link:
subject: Java MVC ActionListener NullPointerException
It's not a secret anymore!