This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pressing Enter In JTable