Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2007, 04:49 PM
Member
 
Join Date: May 2007
Posts: 42
Freddie is on a distinguished road
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 03:08 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-09-2007, 05:17 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
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 05:20 PM.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-09-2007, 06:46 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 84
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
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, 04:34 PM
Member
 
Join Date: May 2007
Posts: 4
John is on a distinguished road
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, 01:48 AM
Member
 
Join Date: May 2007
Posts: 42
Freddie is on a distinguished road
john, you´re right, I did it as you say and worked it!
thanks you
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

vB 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 0 02-07-2008 12:28 PM
Canvas rendered over JCombobox menu JSK AWT / Swing 2 11-19-2007 09:00 PM
Adding items to a jComboBox tronovan New To Java 0 08-08-2007 09:48 AM
JComboBox setDisabledTextColor Jack AWT / Swing 2 07-02-2007 06:32 AM
Help with jComboBox Marcus AWT / Swing 2 07-02-2007 12:08 AM


All times are GMT +3. The time now is 01:14 AM.


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