I am new to Java and fairly new to programming in general. I have spent a couple of years in MS Access/VB.
In my quest to broaden my skill set I have started to play with Java. Honestly it seems to require a lot of code and classes to do the littlest thing.
My issue is this I have a mysql db with a customer table. I want by combobox to store the id and customer name but only display the customer name in the combobox.
When the user selects a customer I want the id to query the jtable and display the customer info.
I need to reference this id from the combobox to correctly populate the table.
So my table will look like this
id customername address city
1 customer1 123 this st atown
3 customer2 5 that st btown
4 customer 3 989 overhere st ctown
2 customer 4 9999 overthere st dtown
6 customer 5 234 thisstreet st etown
So when the user selects customer2 from the combobox it will in turn say customer2's id is 3.
3 will then be used to query the customer information and display this in the table.
I hope iam explaining this correctly... this was very common in ms access but all i had todo was hide the column with the id so it only displayed the customer name. When a new customer was selected it would take the hidden id column value to populate a table. It was extremely easy.