File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Disable certain rows in a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable certain rows in a JTable" Watch "Disable certain rows in a JTable" New topic

Disable certain rows in a JTable

Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
Hi All,
I thought this would be trivial, but it's not! I just want to disable certain rows of a JTable from being selected and to make them grayed out to appear uneditable to the user. Any ideas?
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
You make them non-editable with isCellEditable() of your model. The color with a renderer.
I agree. Here's the link:
subject: Disable certain rows in a JTable
It's not a secret anymore!