Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DefaultTableModel

Posted on 2004-10-05
3
Medium Priority
?
195 Views
Last Modified: 2008-02-01
All-

-I am offerring 125 points for this question b/c it is a kind of double question indirectly.

I have heard mixed reviews about some people saying the DefaultTableModel is great to use and others say it is evil.   Can someone set the record straight?

Also, is it possible to delete row from the DefaultTableModel and still be able to loop thur all the elements.

I am using a vector of vectors as my table model. I am really just wanting to delete the row from the JTable not really delete it from the vector of vectors itself.  Not sure if that is possible though.

Riight now I am just setting the rowheight to 1 as a workaround.

any ideas?

-mmetzger

0
Comment
Question by:mmetzger
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 12233144
You could use a copy of your data in your table model and remove the row from there. The original Vector of Vectors could be used to iterate thru if you wanted to loop thru the entire original data.

Alternatively you'd need to create your own table model subclass that supported marking rows that should not be displayed, and also provide a means to iterate thru all the rows.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question