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

Selecting a single cell in a JTable

 
Kevin Tysen
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to find a way to select a single cell in a JTable. I know how to configure so that the user can select a single row or a single column, but how should I configure so that only one cell can be selected?
If that is not possible, then how can I get the cell in a row that has focus? When the user clicks one cell, the whole row is selected, but only that cell that is clicked has focus. What method can return the cell, or column of the cell that has focus?
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you want to set the cell selection enabled? (hint, hint)
 
Kevin Tysen
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, setCellSelectionEnabled(boolean)? I didn't notice that one. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic