Applet error - Null pointer exception?
The applet loads fine the first time I navigate to the page.
Upon refresh, i get java.lang.NullPointer exception.
Here is my java console information:
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
java.lang.NullPointerException
at JAppletTrial_1.populate_combobox(JAppletTrial_1.java:136)
at JAppletTrial_1.start(JAppletTrial_1.java:61)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Exception: java.lang.NullPointerException
Exception in thread "thread applet-JAppletTrial_1.class" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
My applet, populate combobox function looks like this:
public void populate_combobox(){
try {
ResultSet rs = selectStmt.executeQuery();
while(rs.next()) {
cboClass obj1 = new cboClass(rs.getString(2), rs.getString(3), rs.getString(1));
this.jcboPerson.addItem(obj1);
}
} catch(SQLException e) {
e.printStackTrace();
}
Like i say, it runs fine the first time. Refreshes will work after a while. Maybe some thread times out after a while? How do I make it work every time?

