Tuesday, 15 February 2011

swing - Java jTable column listener -


itemprop = "text">

after

Boolean with value JTable (GUI layout manager) In one column, you will see that a checkbox will appear in this column. This is the reason that all is fine with me but now I get the output of the whole line of data, when I want to press the checkbox to a column cell event listener.

Now I have some success with JTable .getModel (). AddTableModelListener , but it has an effect on its entire table

  jTabelRooster.getModel (). AddTableModelListener (New TableModelListener) {Public Zero TableChanged (TableModelEvent evt) {String lidnummer = jTabelRooster.getValueAt (evt.getLastRow (), 0) .toString (); Int parseLidnummer = Integer Paracetameter (string) Ledwornum = JetBlarOr Tightlight (evt.getLastRow), 1) .Testing (); String LDectorName = JetabellRoever.itAlite (evt.getLastRow), 3) .toString (); boolean aanwezig = Boolean.parseBoolean (jTabelRooster.getValueAt (evt.getLastRow ( ), 4) .toString ());}});   

Can someone hell in this case?

Why do not you override the function of your tablespace? It gets two coordinates in the tablemodel, and the value entered by the user

  class YourTableModel extends yourBaseTableModel {public to set default set to NetValueAt (Object Avalue, integer rowIndex, integer columnIndex) Behavior, if you do not write this method yourself super.setValueAt (aValue, rowIndex, columnIndex); (ColumnIndex == theBooleanColumnIndex) {// can now use the built-in row with rowIndex} if}}    

No comments:

Post a Comment