473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Editable JComboBox in JTable

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
1 9881
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben Munday | last post by:
Hi all, I have a problem with a Checkbox in a JTable. When i add the Checkbox into the JTable it displays the String representation of the Checkbox, which is not what i want. So, i created a...
1
by: asd | last post by:
I need to make the cells in the 1st column look like the column header. I tried the following code but it didn't change anything: private void rendererTest() { TableColumn column =...
1
by: raysaun | last post by:
I am trying to set a TableCellEditor for a JTable, however, the editor never seems to get called. I can not even get a simplified version (below) to work. When I put a breakpoint on the return...
1
by: Andrea Sansottera | last post by:
Hi fellows, I was wondering if in the Java API there's a way to easily map a disconnected RowSet to a JTable... I have looked at the doc but i did not found anything. What I want is simply do...
2
by: jerico | last post by:
Hi, I am developing an application for which I need to increase the size of the JComboBox.But it is not getting increased.I used the following technique: Container cont; JComboBox valueTypeBox ;...
1
by: onsir | last post by:
I have code like this, but still wrong. how to show data from database in JTable. package my.JavaNetBean; import java.sql.*; import java.io.*; import java.sql.Connection; import...
8
by: dycharles | last post by:
I have a JComboBox loaded with 20,000 data, my problem is when i scroll down or scroll up, it is slower than the JComboBox with the smaller data. What can i do to make my JComboBox run faster or like...
2
by: dycharles | last post by:
hi, can anyone guide me or give me a code on how to put the jtable inside the jcombobox? or maybe someone can suggest what is the best approach to this problem. regards, dycharles
2
by: HaifaCarina | last post by:
i have this unfinished java program and i can't figure out what is the problem.. please help... /** * @(#)Answer3.java * * * @author * @version 1.00 2008/1/17
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.