wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Pressing Enter In JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Pressing Enter In JTable" Watch "Pressing Enter In JTable" New topic
Author

Pressing Enter In JTable

John Smith
Ranch Hand

Joined: Jul 20, 2001
Posts: 84
Hello,
How can I prevent a JTable from jumping to the next row when enter is pressed? Thanks...
Randy
John Smith
Ranch Hand

Joined: Jul 20, 2001
Posts: 84
I should have done a more thorough search before I posted. This has already been answered in another post by Cindy Glass. Simply attach a key listener to the JTable, look for the enter key being pressed, and consume it. Example:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pressing Enter In JTable
 
Similar Threads
JTable
JTable
JTable
JTable
JTable