Click here to Skip to main content
15,894,106 members
Home / Discussions / Java
   

Java

 
QuestionJCOMBOBOX Pin
Chrisloys4-Dec-12 2:40
Chrisloys4-Dec-12 2:40 
AnswerRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 4:52
mveRichard MacCutchan4-Dec-12 4:52 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 5:36
Chrisloys4-Dec-12 5:36 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 5:58
mveRichard MacCutchan4-Dec-12 5:58 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:04
Chrisloys4-Dec-12 6:04 
No the numbers are not random per say they are developed by mysql as they are autonumber/primarykey. So if we had two customers with same name they would have two differnt ids. 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 e town

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.
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:10
mveRichard MacCutchan4-Dec-12 6:10 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:12
Chrisloys4-Dec-12 6:12 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:34
mveRichard MacCutchan4-Dec-12 6:34 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:41
Chrisloys4-Dec-12 6:41 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:44
mveRichard MacCutchan4-Dec-12 6:44 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:47
Chrisloys4-Dec-12 6:47 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 7:24
mveRichard MacCutchan4-Dec-12 7:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.