Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Perhaps your problem was the <code>getColumnClass()</code> returning null instead of <code>Object.class</code></p> <p>Use AbstractTableModel as your base class. This way you won't need so many methods. As it is you have just started to handle all the event stuff needed. If you want to do it, copy that code from 'AbstractTableModel` using either the Oracle/Sun source or some other source. Here is some source for some version that will give you and idea of how much code there is to handle the events: <a href="http://developer.classpath.org/doc/javax/swing/table/AbstractTableModel-source.html" rel="nofollow">Java Source for AbstractTableModel</a></p> <pre><code>public class MyTableModel extends AbstractTableModle { private MyDataClass myData; // holds the cell data private static final String[] colNames = {"bla", "blabla", "hola", "hej", "egle", "begle", "eciepecie"}; public MyTableModel(MyDataClass val) { myData = val; myData.data = new Object[7][7]; } @Override public int getColumnCount() { return myData.data.length; } @Override public int getRowCount() { return myData.data[0].length; } @Override public Object getValueAt(int arg0, int arg1) { return myData.data[arg0][arg1]; } @Override public String getColumnName(int columnIndex) { return colNames[columnIndex]; } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { if (rowIndex == columnIndex) return false; else return true; } @Override public void setValueAt(Object aValue, int rowIndex, int columnIndex) { myData.data[columnIndex][rowIndex] = aValue; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload