Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enter key and JTable

 
Rahul Mahindrakar
Ranch Hand
Posts: 1868
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I want to capture the Enter key pressed for the JTable. Any ideas as to how to do it. By default pressing the Enter key will move the row selection down. I would like to change this. How is the question.

[This message has been edited by Rahul Mahindrakar (edited February 09, 2001).]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you put a listener for a KeyEvent looking for VK_ENTER you can insert some control code when the key in pressed.
 
Joachim Olga
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a key listener doesn't react to the first press on the enter key, only the second.
 
nikos sokaf
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It reacts on the first KEY stroke by using the following method:

table.setSurrendersFocusOnKeystroke(true);
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic