!Ahhh JTable JComboBox woes

Discussion in 'Java' started by timasmith@hotmail.com, Aug 9, 2006.

  1. Guest

    So I have a CombBox sitting in my table but every time I press any
    letter it bumps me out to the next control on the form.

    I stopped that by extending DefaultCellEditor and returning false on
    stopCellEditing

    @Override
    public boolean stopCellEditing() {
    return false;
    }

    So the question remains on the best way to

    a) Capture that enter or selection occurred in the combo box editor
    b) stopCellEditing AND put the focus on the next cell not control.

    thanks
     
    , Aug 9, 2006
    #1
    1. Advertising

  2. wrote:
    > So I have a CombBox sitting in my table but every time I press any
    > letter it bumps me out to the next control on the form.

    It seems you have some weird focus handling implemented in your form.
    But I can't say more without seeing your code.
    >
    > I stopped that by extending DefaultCellEditor and returning false on
    > stopCellEditing
    >
    > @Override
    > public boolean stopCellEditing() {

    No good idea! You should at least call
    super.stopCellEditing();
    here. Otherwise the cell editor doesn't write the selected ComboBox
    value back into the JTable's data.
    > return false;
    > }
    >
    > So the question remains on the best way to
    >
    > a) Capture that enter or selection occurred in the combo box editor
    > b) stopCellEditing AND put the focus on the next cell not control.




    --
    Thomas
     
    Thomas Fritsch, Aug 9, 2006
    #2
    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. Chris
    Replies:
    0
    Views:
    8,257
    Chris
    Jun 14, 2005
  2. Yulia
    Replies:
    1
    Views:
    681
    Andrew Thompson
    Jul 4, 2005
  3. lizard

    JTable in JComboBox

    lizard, Jan 27, 2006, in forum: Java
    Replies:
    7
    Views:
    10,869
    valprivate
    Jul 27, 2012
  4. Replies:
    2
    Views:
    3,211
    Jon Martin Solaas
    May 13, 2006
  5. sonaljain

    JComboBox not visible in JTable

    sonaljain, Mar 18, 2011, in forum: Java
    Replies:
    0
    Views:
    424
    sonaljain
    Mar 18, 2011
Loading...

Share This Page