Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Disabling Cell Focusing in JTable  RSS feed

 
Amaresh P
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I disable the cell focusing in JTable. I want to select a row without highlighting any particular cell.
Amaresh
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, Amaresh is not a valid user name... please re-read the JavaRanch User Name Guidelines and re-register with a valid username. User names must be in the format "First Name" + space + "Last Name".

On to the question...

How you will do this depends on the reason you are doing it... If you override isCellEditable() in your table model the cell selection is less obvious, but you cannot edit the value in the cell. If you want there to be no cell selection at all, or if you need to edit cell values, then you need to make new CellEditors and set the background color to be the selection background color and remove the colored border.

-Nate
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!