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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -