File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 JavaScript Promises Essentials this week in the JavaScript 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