By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

Editable JComboBox in JTable

P: n/a
When I select a normal cell with a default editor for strings and press
a letter key, the letter is automaticaly typed in the cell, but when I
select a cell with an editable JComboBox editor and press a letter key
it only "opens" the JComboBox editor. I then have to press the key again
to type it in the combobox.
How can I fix this, why is the first keypress "lost"?
(btw, surrenderFocusOnKeystroke is set to true)
Oct 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Robert.

I'm not sure this is what you are looking for,
but hopefully it is.

private void jComboBox1KeyReleased(java.awt.event.KeyEvent evt) {
jComboBox1.setSelectedItem(String.valueOf(evt.getK eyChar()));
}

WarmRegards
Darko Topolsek

"Robert" <ro**************@etfos.hr> wrote in message
news:dj**********@ss405.t-com.hr...
When I select a normal cell with a default editor for strings and press a
letter key, the letter is automaticaly typed in the cell, but when I
select a cell with an editable JComboBox editor and press a letter key it
only "opens" the JComboBox editor. I then have to press the key again to
type it in the combobox.
How can I fix this, why is the first keypress "lost"?
(btw, surrenderFocusOnKeystroke is set to true)

Dec 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.