Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - JTable - using a 2D vector with AbstractTableModel

 
Thread Tools Search this Thread
Old 04-20-2004, 05:06 PM   #1
Default JTable - using a 2D vector with AbstractTableModel


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
  Reply With Quote
Old 04-21-2004, 11:34 AM   #2
Thomas Weidenfeller
 
Posts: n/a
Default Re: JTable - using a 2D vector with AbstractTableModel
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updaing database from JTable alniyas Software 0 09-13-2007 06:48 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46