Solved

DefaultTableModel

Posted on 2004-10-05
3
185 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 125 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now