![]() |
|
|
|||||||
![]() |
Java - JTable - using a 2D vector with AbstractTableModel |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I have written a 2D vector class; vector of vectors; and would like to
use it with the AbstractTableModel class. I have put an instance of the 2D vector class into the AbstractTableModel interface and have removed the static 2D array code. My problem is that the AbstractTableModel does not recognize the 2D vector as far as placing data from that vector into the table. Am I missing something somewhere? thanks, have a great day, JP Deshaies |
|
|
|
|
#2 |
|
Posts: n/a
|
Deshaies wrote:
> I have written a 2D vector class; vector of vectors; and would like to > use it with the AbstractTableModel class. I have put an instance of > the 2D vector class into the AbstractTableModel interface AbstractTableModel is a class, not an interface. > and have removed the static 2D array code. There is no such thing supposed to be removed from AbstractTableModel when you subclass it. Are you by any chance messing with some other class, or are you even messing with the source code of AbstractTableModel? > My problem is that the AbstractTableModel does not recognize the 2D > vector as far as placing data from that vector into the table. > > Am I missing something somewhere? We can only guess without seeing your source code. Maybe you messed up on line 32? And what about this statement from the API documentation: <quote> To create a concrete TableModel as a subclass of AbstractTableModel you need only provide implementations for the following three methods: public int getRowCount(); public int getColumnCount(); public Object getValueAt(int row, int column); </quote> Did you do that? /Thomas Thomas Weidenfeller |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Updaing database from JTable | alniyas | Software | 0 | 09-13-2007 06:48 AM |