-
jcombobox
hello everybody, I want to know how can I load a combo with a table with 2 columns where a column was the text that I want to show it in the dropdownlist, and the second column is that the value that I need to use.
an example woud be
Code:
contacttable[1,1] = "TLF"
contacttable[1,2] = "telephone"
contacttable[2,1] = "FAX"
contacttable[2,2] = "Fax"
contacttable[3,1] = "MOV"
contacttable[2,2] = "Móvil"
In the ddp I want to show: telephone, Fax, Movil
and the values must beTLF, FAX, MOV.
Can you help me?
Thank you
Fred
-
Why don't you use two combo boxes? I did not understand your problem. As far as i know, a combo box can only show one column.
P.S. Thread is moved to AWT/Swing Forum.
-
IS this really swing/awt or is this a web application? You don't really say.Can you maybe try to make a little drawing or something to explain better what you want?
-
How to Use Combo Boxes (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
I think that you have to use 2 arrays, an array must be the same that you describe and the other should content the values list..
-
john, you´re right, I did it as you say and worked it!
thanks you