Vector results need to be available to another class
Thanks to Furable and Richersoon my project has moved on nicely.
However I am stuck on what should be a simple fix for those in the know.
I have a class (DatabaseAcess) which accesses a mysql database and retrives a list of tables and a list of entry types from one of the tables. I am as recommended using a vector to collect the data from the query.
Within the same class I can populate my jcomboboxes with the results returned.
The vectors are declared as:
public static final ComboBoxModel vtable = null;
public static final ComboBoxModel vtype = null;
I have a separate class for my GUI and cannot get the values to use within this class.
I have tried all sorts but no success so far. Currently the line I am having problems with is:
tables = new JComboBox(MyProject.DatabaseAccess.vtable);
and I am getting the following error:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.JComboBox.setModel(Unknown Source)
at javax.swing.JComboBox.<init>(Unknown Source)
If I try system.out.println I get null
I have tried importing MyProject.* and Java.io.*
But (according to the IDE) neither of these are being used.
I am at a loss to know what the fix is. The nearest I have got is no errors and blank jcomboboxes.
Could someone please enlighten me?
Thank you very much.