There are multiple ways to add the feature.
The first one is implementing custom Renderer/Editor for the cell. The renderer keeps row/column and isPressed state. When mouse is pressed renderer state is set and reset on release.
Another way is to override JTable's
paintComponent() method to draw the Rectangle
with e.g. semi-transparent color.