| Author |
JTable question
|
igwe kalu kalu ogba
Ranch Hand
Joined: Feb 03, 2005
Posts: 133
|
|
Hello, I'm having this problem with JTables. I created one by using the following code: JTable table = new JTable(4,2) { public boolean isCellEditable(int rowIndex, int columnIndex) { return false; } }; But, the thing is, I only want the 1st column of every row to be uneditable. It is supposed to be like a key/value pair. How can I make only the second column of each of my rows to be editable. Thank you.
|
 |
Lionel Badiou
Ranch Hand
Joined: Jan 06, 2005
Posts: 140
|
|
You may try to check columnIndex == 1... Hope that helps,
|
Lionel Badiou
CodeFutures Software
|
 |
igwe kalu kalu ogba
Ranch Hand
Joined: Feb 03, 2005
Posts: 133
|
|
|
Um, it doesn't work, where do I put columnIndex == -1; thanks.
|
 |
igwe kalu kalu ogba
Ranch Hand
Joined: Feb 03, 2005
Posts: 133
|
|
Ok, I figured it out, this is the code I used instead: JTable table = new JTable(4,2) { public boolean isCellEditable(int rowIndex, int columnIndex) { boolean returnValue = false; if (columnIndex == 1) { return true; }//end if return returnValue; } };
|
 |
 |
|
|
subject: JTable question
|
|
|