!Ahhh JTable JComboBox woes

T

timasmith

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
 
T

Thomas Fritsch

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top