Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTable issues

843804Dec 2 2004 — edited Dec 3 2004
Got 2 JTable issues:
1. Hitting a DELETE KEY when a table cell is in fcous should clear that contents of that cell. I added KeyListener to the table and trying to clear the cell contents but as soon I hit the DELETE key the editor is activated and my keylistener action is not effective. (The editor being the JTextfield). My question is where is it defined in the JTable that hitting a DELETE key should invoke the editor and how should I stop the JTable to invoke the editor..
2. When a cell is in focus and the user starts typing JTable invokes the editor , which is JTextfield, which is all good. Now, how would I make the JTextfield to select all the contents in it so that when the user starts typng it should overwrite existing contents rather than appending to it, which is the default case now.

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2004
Added on Dec 2 2004
3 comments
142 views