🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #42

Problem updating JTable

#42
From: Seth D. Haney
Date: Wed, 30 Aug 2000 00:00
43 lines
2709 bytes
I am having serious problems using an AbstractTableModel and updating
the data in my data Table I call this method :


 public void fill(String[] filelist) {

        dataVector = new Vector();
        Name = new Vector();
        Name.addElement("Molecule Names");

        for (int i=0; i<=filelist.length -1; i++) {
                Vector tempVector = new Vector();
                tempVector.addElement(filelist[i]);
                System.out.println((String)tempVector.elementAt(0));
                dataVector.addElement(tempVector);
                System.out.println(new
Integer(dataVector.size()).toString());
        //      setValueAt(filelist[i],i,0);
                fireTableChanged(new TableModelEvent(this));
                System.out.println("setting Value: " + filelist[i] + "
at position" + new Integer(i).toString());

                }
        System.out.println(new Integer(dataVector.size()).toString());
        }          
         
The output shows every string in filelist and displays the size going
from 1 to the length of filelist and then agian the last time but there
is no change in the datatable.  If I then use another method to print
the data from the Vector it prints what was there before the use of this
method. Does anyone have any idea what is going on??
 
btw I do not get any compiler or other errors.

Your help is much appreciated
-- 
#########                     Seth  D. Haney                 #########
#  Haney Associates                            Phone - 858-483-1197  #
#  5455 Westknoll Dr.                            FAX - 858-483-1046  #
#                                  area code changed   ^^^           #
#  La Jolla, CA 92037                       Email - haney@hbond.com  #
#                                                                    #
#################                                #####################
Technical Details
Message-ID: <39AD7FC3.FAF43842@hbond.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,7c3f4d3386f16eec,start
X-Google-Attributes: gid111d45,public
X-Google-Thread: f74b3,7c3f4d3386f16eec,start
X-Google-Attributes: gidf74b3,public
X-Google-Thread: 107d46,7c3f4d3386f16eec,start
X-Google-Attributes: gid107d46,public
From: "Seth D. Haney" <seth@hbond.com>
Subject: Problem updating JTable
Date: 2000/08/30
Message-ID: <39AD7FC3.FAF43842@hbond.com>
X-Deja-AN: 664503013
Content-Transfer-Encoding: 7bit
Organization: Haney Associates
X-Accept-Language: en
X-Server-Date: 30 Aug 2000 21:43:17 GMT
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Reply-To: seth@hbond.com
Newsgroups: borland.public.jbuilder.java.swing,borland.public.jbuilder.java.language,comp.lang.java.databases