I'm coding a jdbc program with jdk1.4.1 and ms/access .
The viewing of the contents of each table in the database is running well.
Viewing is designed as a table and also row by row.
For inserting data row by row in a selected table i used an "addnext" button
whose function is to fetch the values from all the rows ,insert them into
the table and clear up the text fields for the user to enter new data.
While running, when i press the "addnext" button problem occurse.
The console gives the following message:
java.lang.NullPointerException
at additionframe$3.run(test2.java:832)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
I don't have well knowledge abt threads.
Can u please suggest a solution.
The code is given in the attachment addfrm.txt
Quote:
Originally posted by progprob
[b]I'm coding a jdbc program with jdk1.4.1 and ms/access .
|
that code is a total mess, and i get the impression that you've written nearly the entire thing into one java file.. as a result, i cant really tell what is where.. or why you've posted additionframe.txt when the error is on test2.java, in inner class additionframe, in anonymous inner class number 3 (which i think is the window adapter)
i dont think youre doing yourself any favours adopting this coding style.. use separate files for all your classes!