aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Selecting a single cell in a 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 "Selecting a single cell in a JTable" Watch "Selecting a single cell in a JTable" New topic
Author

Selecting a single cell in a JTable

Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
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

Joined: May 03, 2008
Posts: 4541
    
    5

So, you want to set the cell selection enabled? (hint, hint)


luck, db
There are no new questions, but there may be new answers.
Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
Oh, setCellSelectionEnabled(boolean)? I didn't notice that one. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Selecting a single cell in a JTable