Multiple JComboBoxes with listener etc.
Firstly let me apologise if this has been answered elsewhere but I could not find an answer using the search function.
I am writing what I beleive is a faily basic program which will access a mysql database, get results and then performa calculataions based on the results returned, then display the search criteria and calcualtion result.
I have written the database integration using JDBC and also have the math part sorted both currently created as separate classes. The results of the sql query are public and can be seen by the calculation class.
I have started the code the interrogate the database to return a list of tables but I think I need to use an array rather than a string as currently the result is only the last table in the database - I should be able to fix this myself.
The second query interrogates one of the fields in the chosen table and returns a unique list of results again this is only giving me the last entry...
Finally the third query gets a complete list of available choices from the table chosen and the field type thus narrowing down the result set.
Now what I need to be able to do is create three dropdown JComboBox the first needs to access the database and return a list of tables to choose from, the second needs to access the database again based on the chosen table and return the unique resorts from the field, The third needs to return data from a different field in the tabe based on unique type.
There will also be two text boxes to display the calculation result.
The variables are currently declared and visible to other classes.
Question: Is using a three JComboBox and two JTextBox combination with change watching the best way of acieving this?
I dont want to spend a lot of time working out how to combine this little lot only to find out it doesn't work or there is a better way of doing this.
Sorry for the long winded question but the last time I wrote anything it was in assembler and Java is all new to me.