473,671 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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, surrenderFocusO nKeystroke is set to true)
Oct 21 '05 #1
1 9893
Hi Robert.

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

private void jComboBox1KeyRe leased(java.awt .event.KeyEvent evt) {
jComboBox1.setS electedItem(Str ing.valueOf(evt .getKeyChar())) ;
}

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, surrenderFocusO nKeystroke 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
8627
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 CheckBoxRenderer which extens Checkbox and implements TableCellRenderer. This seems to have done the job, in that the Checkbox is displayed and not the String representation. But, and it's a big 'but', the column that holds the Checkbox continually...
1
8969
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 = tblDecisions.getColumnModel().getColumn(0); TableCellRenderer renderer = column.getHeaderRenderer(); column.setCellRenderer(renderer); }
1
7969
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 statement in getTableCellEditorComponent, it never stops there even though I edit cells in the table. Can anyone tell me what I am missing. By the way, I have gotten TableCellRenderers to work with no problems. public class Frame1 extends...
1
6729
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 the follow: 1. Load: Database -> disconected Rowset -> automapping in a JTable 2. Editing of the data in the table/rowset
2
9913
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 ; valueTypeBox = new JComboBox(); valueTypeBox.addItem("asia"); valueTypeBox.addItem("india"); cont = getContentPane();
1
7379
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 java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException;
8
1868
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 the JComboBox with smaller data? Anyone can help me please. Thanks.
2
2088
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
8721
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
8401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8824
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6236
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.