Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2003

Tip: Looking for answers? Try searching our database.

Disable a JTable row

Thread view: 
Ike - 31 Oct 2003 19:12 GMT
How do I disable and entire row in a JTable? Thanks, Ike
Tor Iver Wilhelmsen - 01 Nov 2003 01:36 GMT
> How do I disable and entire row in a JTable? Thanks, Ike

How disable? In order to not being able to edit, return false from
isCellEditable() for the row. To make it render "disabled", check in a
custom renderer for some custom flag you create in the model.
kk - 02 Nov 2003 21:27 GMT
You have to create a table with a custom Table model.

In the TableModel class:

public class xTableModel extends AbstractTableModel{

.....code.....

   public boolean isCellEditable(int row, int col) {

       ........code....

       if (row==x) return false; //now you can't edit the cells in row x

   }

}

I hope to have been of some assistance

Greetz

Kristof

> How do I disable and entire row in a JTable? Thanks, Ike


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.