java - Set part of JTable cells uneditable -
i created jtable in eclipse using "design" option , want make cells uneditable. code:
public frame(int choice) { initcomponents(); defaultmodel = (defaulttablemodel) m0.getmodel(); if (choice == 0) { defaultmodel.setcolumncount(7); defaultmodel.removerow(6); } defaultmodel.iscelleditable(2,2); defaultmodel.iscelleditable(3,3); } public boolean iscelleditable(int row, int column) { return false; }
cells (2,2) , (3,3) should uneditable. not work. can help?
do see problem here?:
public boolean iscelleditable(int row, int column) { return false; // !!!!!!! }
cells (2,2) , (3,3) should editable. not work. can help?
you're setting cells ineditable iscelleditable(...) method override , you're inexplicably wondering why they're not editable. sorry that's bit crazy. solution change returned iscelleditable(...)
method want to. if want editable 2,2 , 3,3, put logic in method above.
edit
see you've edited question is:
public boolean iscelleditable(int row, int column) { return false; }
cells (2,2) , (3,3) should uneditable. not work. can help?
that of course changes everything. guess iscelleditable not true override of jtable or model. have tried adding @override annotation before it? can show how in fact overriding current jtable or model? need show method in class extends jtable or model , in fact class being used.
Comments
Post a Comment