GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Java lang NullPointerException error 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 lang NullPointerException error" Watch "Java lang NullPointerException error" New topic
Author

Java lang NullPointerException error

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

Below is the function that i m using on two scnerio.

1st Scnerio.
=============
Just click on add button make entry into required fields and click Save Button.

I call this function before saving data into database. If i am calling this function within the form (Class A) then it is working fine and good.

2nd Scnerio
===========
I have 3 classes i.e. Class A, Class B and Class C

While working on Class A i am calling Class B and filling all kind of required data from Class B to global vector in Class C. After setting data from Class B to another Class C via vector, I close down Class B and again going to Class A as it is already opened.

On clicking a single button in Class A to fill my JTable from Class C (Vector), my all data is appearing and working fine.

But while saving as the below function is called i got an error on "Statement" statement i.e. Java.lang.NullPointerException.

System.out.println("Test");
This is not printed.

Can any one tell me why I am getting this error as the same is working in 1st Scnario.





Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
 
GeeCON Prague 2014
 
subject: Java lang NullPointerException error