mysql - Java JTable Listener onChange -
i have data on mysql server , loaded jtable using code below:
try{ st= conn.createstatement(); st.executequery(q); resultset rs = st.executequery(q); borrowers_list.setmodel(dbutils.resultsettotablemodel(rs)); } catch(sqlexception ex){ joptionpane.showmessagedialog(null,ex); }
my data table has boolean, , want display in jtable checkbox. code works table listener not. want have event everytime there's changes in checkbox. used code below doesn't work..
borrowers_list = new jtable(){ @override public class getcolumnclass(int column){ (int row = 0; row < getrowcount(); row++) { object o = getvalueat(row, column); if (o != null) { return o.getclass(); } } return object.class; } }; borrowers_list.getmodel().addtablemodellistener(new tablemodellistener() { public void tablechanged(tablemodelevent e) { // event here } });
how can fix it?
Comments
Post a Comment