Solved

DefaultTableModel

Posted on 2004-10-05
3
187 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange loading of website behaviour 3 32
ForLoop Example 3 40
windows explorer path to command prompt 5 32
fibonacci ten numbers 4 28
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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:

910 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

16 Experts available now in Live!

Get 1:1 Help Now