Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DefaultTableModel

Posted on 2004-10-05
3
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

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…
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

715 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