aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic
Author

JTable

francis varkey
Ranch Hand

Joined: Sep 13, 2005
Posts: 169
Dear Sirs,
how to disable a perticular cell in a JTable ?


thanks in advance,
Francis Varkey
R.Joe
Ranch Hand

Joined: Jun 16, 2004
Posts: 31
by using the AbstractTableModel method isCellEditable(int row, int col)

syntax

public boolean isCellEditable(int row, int col)
{
if (col == 0)
{
return true;
}
else
{
return false;
}
}
francis varkey
Ranch Hand

Joined: Sep 13, 2005
Posts: 169
Dear Sir,
This is working under some fixed conditions. But my cell selection is dynamically. That is, in first row some times first two columns are editable, and in second row first three columns are editable and in third row only first column is editable ... and so on...

how to solve this problem ?

regards francis
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
So what's the problem with public boolean isCellEditable(int row, int col)?

It gives you the row number and the column number, so there's no problem doing different things on different rows. Or do you mean something else by "disable" in the original post?


bitguru blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable