Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: AbstractTableModel, to wrap or not to wrap?
 
Similar Threads
Populating JTable
method criteriaFind
question on in memory find criteria
little boxes in my JTable
save grid data