combo box selection problem

Discussion in 'Java' started by Jacques Chaurette, May 31, 2005.

  1. Hi, this has probably been asked before but I can't find any reference to
    it. In this sample of code I am trying to set the index of a combo box from
    an action_event triggered in another combo box.

    I am having problems using the selectedIndex() method, sometimes it does not
    work like in this code:

    void jComboBoxFitSel_itemStateChanged(ItemEvent e) {

    if (jComboBoxFitSel.getSelectedIndex() == 4)
    {
    jLabel6.setText("pass 4");
    jComboDia.removeAllItems();
    jComboDia.insertItemAt("2.0",0);
    ....
    jComboDia.setSelectedIndex(0);
    }
    else
    {
    jLabel6.setText("pass not 4");
    jComboDia.removeAllItems();
    ...
    jComboDia.setSelectedIndex(3);
    }

    }
    }
    when either one of these conditons are filled the jComboDia.setSelectedIndex
    command does not execute, is there some problem with trying to set an index
    in a combo box from another combo box.

    Cheers, thanks for any help.

    Jack
     
    Jacques Chaurette, May 31, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5nZWw=?=

    COMBO BOX INSTEAD OF DROP DOWN BOX

    =?Utf-8?B?QW5nZWw=?=, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    628
    Ken Cox [Microsoft MVP]
    Jun 29, 2004
  2. rikesh

    Display User Selection From Combo Box

    rikesh, Feb 6, 2004, in forum: ASP General
    Replies:
    8
    Views:
    167
    rikesh
    Feb 9, 2004
  3. Adrian
    Replies:
    1
    Views:
    234
    Bullschmidt
    Feb 18, 2004
  4. dthmtlgod

    Fill Combo Box based on another Combo Box

    dthmtlgod, Nov 16, 2005, in forum: ASP General
    Replies:
    1
    Views:
    604
    Bob Barrows [MVP]
    Nov 16, 2005
  5. SM
    Replies:
    2
    Views:
    381
Loading...

Share This Page