Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2007, 03:49 PM
Member
 
Join Date: May 2007
Posts: 42
Rep Power: 0
Freddie is on a distinguished road
Default 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

Last edited by Freddie; 06-01-2007 at 02:08 PM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-09-2007, 04:17 PM
levent
Guest
 
Posts: n/a
Default
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.

Last edited by levent; 05-09-2007 at 04:20 PM.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-09-2007, 05:46 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 85
Rep Power: 0
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
Default
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?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-10-2007, 03:34 PM
Member
 
Join Date: May 2007
Posts: 4
Rep Power: 0
John is on a distinguished road
Default
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..
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-11-2007, 12:48 AM
Member
 
Join Date: May 2007
Posts: 42
Rep Power: 0
Freddie is on a distinguished road
Default
john, you´re right, I did it as you say and worked it!
thanks you
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change font/ font color etc in a graphic object using JCombobox? JavaInLove AWT / Swing 5 04-25-2009 08:00 PM
Canvas rendered over JCombobox menu JSK AWT / Swing 2 11-19-2007 08:00 PM
Adding items to a jComboBox tronovan New To Java 0 08-08-2007 08:48 AM
JComboBox setDisabledTextColor Jack AWT / Swing 2 07-02-2007 05:32 AM
Help with jComboBox Marcus AWT / Swing 2 07-01-2007 11:08 PM


All times are GMT +2. The time now is 02:24 PM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org