File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Java MVC ActionListener NullPointerException

Mark Calen
Greenhorn

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


Main

m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
please whats wrong with answers on another question, another place
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java MVC ActionListener NullPointerException