Results 1 to 5 of 5

Thread: jcombobox

  1. #1
    Freddie is offline Member
    Join Date
    May 2007
    Posts
    41
    Rep Power
    0

    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
    Java 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.

  2. #2
    levent Guest

    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.

  3. #3
    pegitha is offline Member
    Join Date
    Apr 2007
    Location
    Indiana
    Posts
    83
    Rep Power
    0

    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?

  4. #4
    John is offline Member
    Join Date
    May 2007
    Posts
    4
    Rep Power
    0

    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..

  5. #5
    Freddie is offline Member
    Join Date
    May 2007
    Posts
    41
    Rep Power
    0

    Default

    john, you´re right, I did it as you say and worked it!
    thanks you

Similar Threads

  1. Replies: 5
    Last Post: 04-25-2009, 08:00 PM
  2. Canvas rendered over JCombobox menu
    By JSK in forum AWT / Swing
    Replies: 2
    Last Post: 11-19-2007, 08:00 PM
  3. Adding items to a jComboBox
    By tronovan in forum New To Java
    Replies: 0
    Last Post: 08-08-2007, 08:48 AM
  4. JComboBox setDisabledTextColor
    By Jack in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 05:32 AM
  5. Help with jComboBox
    By Marcus in forum AWT / Swing
    Replies: 2
    Last Post: 07-01-2007, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •