File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes AbstractTableModel, to wrap or not to wrap? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "AbstractTableModel, to wrap or not to wrap?" Watch "AbstractTableModel, to wrap or not to wrap?" New topic
Author

AbstractTableModel, to wrap or not to wrap?

Chiji Nwankwo
Ranch Hand

Joined: Jun 21, 2002
Posts: 56
Hi,
Can anyone tell me if they are wrapping the array of DataInfo objects passed back from the criteriaFind() method, before passing it onto the AbstractTableModel subclass. Or are you just dealing with the raw DataInfo objects and arrays directly?
What is the best approach? It seems when you try to use anything other than two dimensional arrays, it becomes a bit unpleasant.
Please advise.
Thanks,
Chiji


SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I passed the DataInfo class to a method called setDataArray.
In this method I transform the DataInfo class into an Object[][]. It takes only three lines of code.
first create the Object[][] Loop through each record int DataInfo, and call getValues.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Chiji Nwankwo
Ranch Hand

Joined: Jun 21, 2002
Posts: 56
Is getValues one of your own methods?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I don't have a getValues method in my TableModel class.
Oh I see, no that is a method provided to you in the DataInfo class.
Mark
[ July 02, 2002: Message edited by: Mark Spritzler ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AbstractTableModel, to wrap or not to wrap?
 
Similar Threads
method criteriaFind
little boxes in my JTable
Populating JTable
question on in memory find criteria
save grid data