Solved

DefaultTableModel

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse apache tomcat admin console 52 124
JAVA API design with micro service cloud in mind 1 49
ejb message driven bean mdb creation steps 2 24
Java basic valueOf question 1 29
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

821 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