File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pressing Enter In JTable

 
John Smith
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
How can I prevent a JTable from jumping to the next row when enter is pressed? Thanks...
Randy
 
John Smith
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic