This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 4523
    
    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.
 
Consider Paul's rocket mass heater.
 
subject: Selecting a single cell in a JTable
 
Similar Threads
JTable cell is selected but i want the entire row to be selected
JTable selections
TAB Key Functionality on JTable
JTable customize : RowSelection
JTable